How to use braces - 8 common examples

To help you get started, we’ve selected a few braces examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github karma-runner / karma / lib / watcher.js View on Github external
patterns.map((pattern) => {
    // expand ['a/{b,c}'] to ['a/b', 'a/c']
    expandedPatterns = expandedPatterns.concat(braces.expand(pattern, { keepEscaping: true }))
  })
  expandedPatterns
github makuga01 / dnsFookup / FE / node_modules / chokidar / index.js View on Github external
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;
  }
github weixin / Miaow / node_modules / chokidar / index.js View on Github external
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;
  };
github Kode / khamake / node_modules / chokidar / index.js View on Github external
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;
  };
github polakowo / datadocs / website / node_modules / chokidar / index.js View on Github external
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;
  }
github peterqliu / threebox / node_modules / chokidar / index.js View on Github external
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;
  };
github sx1989827 / DOClever / Desktop / node_modules / chokidar / index.js View on Github external
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;
  };
github dkundel / vscode-new-file / src / file-controller.ts View on Github external
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);
  }

braces

Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.

MIT
Latest version published 10 months ago

Package Health Score

85 / 100
Full package analysis

Popular braces functions