JSFiddle - React, Tailwind, and code Playground

by neonDog

JavaScript

let include = ['#/style/size'];
let exclude = false;

let newPath = '#/style';
//newPath = '#/style/size';

//include = true;
//exclude = ['#/style/size'];


let keepGoing = true;


if (include === false || (Array.isArray(include) && !include.some(a => a.startsWith(newPath)))) {
	keepGoing = false;
}
if (exclude === true || (Array.isArray(exclude) && exclude.some(a => newPath.startsWith(a)))) {
  keepGoing = false;
}


console.log('keepGoing', keepGoing);