Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
patterns.map((pattern) => {
// expand ['a/{b,c}'] to ['a/b', 'a/c']
expandedPatterns = expandedPatterns.concat(braces.expand(pattern, { keepEscaping: true }))
})
expandedPatterns
getDirParts(path) {
if (!this.hasGlob) return [];
const parts = [];
const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path];
expandedPath.forEach((path) => {
parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE));
});
return parts;
}
var getDirParts = function(path) {
if (!hasGlob) return false;
var parts = [];
var expandedPath = braces.expand(path);
expandedPath.forEach(function(path) {
parts.push(sysPath.relative(watchPath, path).split(/[\/\\]/));
});
return parts;
};
var getDirParts = function(path) {
if (!hasGlob) return false;
var parts = [];
var expandedPath = braces.expand(path);
expandedPath.forEach(function(path) {
parts.push(sysPath.relative(watchPath, path).split(/[\/\\]/));
});
return parts;
};
getDirParts(path) {
if (!this.hasGlob) return [];
const parts = [];
const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path];
expandedPath.forEach((path) => {
parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE));
});
return parts;
}
var getDirParts = function(path) {
if (!hasGlob) return false;
var parts = [];
var expandedPath = braces.expand(path);
expandedPath.forEach(function(path) {
parts.push(sysPath.relative(watchPath, path).split(/[\/\\]/));
});
return parts;
};
var getDirParts = function(path) {
if (!hasGlob) return false;
var parts = [];
var expandedPath = braces.expand(path);
expandedPath.forEach(function(path) {
parts.push(sysPath.relative(watchPath, path).split(/[\/\\]/));
});
return parts;
};
public async createFiles(userEntry: string): Promise {
if (!this.settings.expandBraces) {
return Promise.all([this.createFile(userEntry)]);
}
const newFileNames = braces.expand(userEntry);
const fileCreationPromises: Array<
Promise
> = newFileNames.map(fileName => this.createFile(fileName));
return Promise.all(fileCreationPromises);
}