Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (/(\.[^.\/])/.test(path)) {
if (segsLength > 1) {
return segs;
} else {
return [str];
}
}
val = splice(str, outter, path);
if (/\{[^{}]+?\}/.test(val)) {
arr = braces(val, arr, opts);
} else if (val !== '') {
if (opts.nodupes && arr.indexOf(val) !== -1) { continue; }
arr.push(es6 ? tokens.after(val) : val);
}
}
if (opts.strict) { return filter(arr, filterEmpty); }
return arr;
}
if (/(\.[^.\/])/.test(path)) {
if (segsLength > 1) {
return segs;
} else {
return [str];
}
}
val = splice(str, outter, path);
if (/\{[^{}]+?\}/.test(val)) {
arr = braces(val, arr, opts);
} else if (val !== '') {
if (opts.nodupes && arr.indexOf(val) !== -1) { continue; }
arr.push(es6 ? tokens.after(val) : val);
}
}
if (opts.strict) { return filter(arr, filterEmpty); }
return arr;
}
if (/(\.[^.\/])/.test(path)) {
if (segsLength > 1) {
return segs;
} else {
return [str];
}
}
val = splice(str, outter, path);
if (/\{[^{}]+?\}/.test(val)) {
arr = braces(val, arr, opts);
} else if (val !== '') {
if (opts.nodupes && arr.indexOf(val) !== -1) { continue; }
arr.push(es6 ? tokens.after(val) : val);
}
}
if (opts.strict) { return filter(arr, filterEmpty); }
return arr;
}
if (/(\.[^.\/])/.test(path)) {
if (segsLength > 1) {
return segs;
} else {
return [str];
}
}
val = splice(str, outter, path);
if (/\{[^{}]+?\}/.test(val)) {
arr = braces(val, arr, opts);
} else if (val !== '') {
if (opts.nodupes && arr.indexOf(val) !== -1) { continue; }
arr.push(es6 ? tokens.after(val) : val);
}
}
if (opts.strict) { return filter(arr, filterEmpty); }
return arr;
}
if (/(\.[^.\/])/.test(path)) {
if (segsLength > 1) {
return segs;
} else {
return [str];
}
}
val = splice(str, outter, path);
if (/\{[^{}]+?\}/.test(val)) {
arr = braces(val, arr, opts);
} else if (val !== '') {
if (opts.nodupes && arr.indexOf(val) !== -1) { continue; }
arr.push(es6 ? tokens.after(val) : val);
}
}
if (opts.strict) { return filter(arr, filterEmpty); }
return arr;
}
return escapePaths(str, arr, opts);
case ' ':
return splitWhitespace(str);
case '{,}':
return exponential(str, opts, braces);
case '{}':
return emptyBraces(str, arr, opts);
case '\\{':
case '\\}':
return escapeBraces(str, arr, opts);
case '${':
if (!/\{[^{]+\{/.test(str)) {
return arr.concat(str);
} else {
es6 = true;
str = tokens.before(str, es6Regex());
}
}
if (!(braceRe instanceof RegExp)) {
braceRe = braceRegex();
}
var match = braceRe.exec(str);
if (match == null) {
return [str];
}
var outter = match[1];
var inner = match[2];
if (inner === '') { return [str]; }
return escapePaths(str, arr, opts);
case ' ':
return splitWhitespace(str);
case '{,}':
return exponential(str, opts, braces);
case '{}':
return emptyBraces(str, arr, opts);
case '\\{':
case '\\}':
return escapeBraces(str, arr, opts);
case '${':
if (!/\{[^{]+\{/.test(str)) {
return arr.concat(str);
} else {
es6 = true;
str = tokens.before(str, es6Regex());
}
}
if (!(braceRe instanceof RegExp)) {
braceRe = braceRegex();
}
var match = braceRe.exec(str);
if (match == null) {
return [str];
}
var outter = match[1];
var inner = match[2];
if (inner === '') { return [str]; }
return escapePaths(str, arr, opts);
case ' ':
return splitWhitespace(str);
case '{,}':
return exponential(str, opts, braces);
case '{}':
return emptyBraces(str, arr, opts);
case '\\{':
case '\\}':
return escapeBraces(str, arr, opts);
case '${':
if (!/\{[^{]+\{/.test(str)) {
return arr.concat(str);
} else {
es6 = true;
str = tokens.before(str, es6Regex());
}
}
if (!(braceRe instanceof RegExp)) {
braceRe = braceRegex();
}
var match = braceRe.exec(str);
if (match == null) {
return [str];
}
var outter = match[1];
var inner = match[2];
if (inner === '') { return [str]; }
return escapePaths(str, arr, opts);
case ' ':
return splitWhitespace(str);
case '{,}':
return exponential(str, opts, braces);
case '{}':
return emptyBraces(str, arr, opts);
case '\\{':
case '\\}':
return escapeBraces(str, arr, opts);
case '${':
if (!/\{[^{]+\{/.test(str)) {
return arr.concat(str);
} else {
es6 = true;
str = tokens.before(str, es6Regex());
}
}
if (!(braceRe instanceof RegExp)) {
braceRe = braceRegex();
}
var match = braceRe.exec(str);
if (match == null) {
return [str];
}
var outter = match[1];
var inner = match[2];
if (inner === '') { return [str]; }
return escapePaths(str, arr, opts);
case ' ':
return splitWhitespace(str);
case '{,}':
return exponential(str, opts, braces);
case '{}':
return emptyBraces(str, arr, opts);
case '\\{':
case '\\}':
return escapeBraces(str, arr, opts);
case '${':
if (!/\{[^{]+\{/.test(str)) {
return arr.concat(str);
} else {
es6 = true;
str = tokens.before(str, es6Regex());
}
}
if (!(braceRe instanceof RegExp)) {
braceRe = braceRegex();
}
var match = braceRe.exec(str);
if (match == null) {
return [str];
}
var outter = match[1];
var inner = match[2];
if (inner === '') { return [str]; }