How to use the @ionic/utils-array.map function in @ionic/utils-array

To help you get started, we’ve selected a few @ionic/utils-array 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 ionic-team / ionic-cli / packages / @ionic / utils-subprocess / src / index.ts View on Github external
async function _findExecutables(program: string, { PATH = process.env.PATH, PATHEXT = process.env.PATHEXT || DEFAULT_PATHEXT }: WhichOptions = {}): Promise {
  const pathParts = getPathParts(PATH);
  let programNames: string[];

  // if windows, cycle through all possible executable extensions
  // ex: node.exe, npm.cmd, etc.
  if (TERMINAL_INFO.windows) {
    const exts = getPathParts(PATHEXT).map(ext => ext.toLowerCase());
    // don't append extensions if one has already been provided
    programNames = exts.includes(pathlib.extname(program).toLowerCase()) ? [program] : exts.map(ext => program + ext);
  } else {
    programNames = [program];
  }

  return ([] as string[]).concat(...await map(programNames, async (programName): Promise =>
    concurrentFilter(pathParts.map(p => pathlib.join(p, programName)), async p => isExecutableFile(p))));
}
github ionic-team / ionic-cli / packages / ionic / src / commands / deploy / manifest.ts View on Github external
private async getFilesAndSizesAndHashesForGlobPattern(buildDir: string): Promise {
    const contents = await readdirp(buildDir, { filter: item => !/(css|js)\.map$/.test(item.path) });
    const stats = await map(contents, async (f): Promise<[string, fs.Stats]> => [f, await stat(f)]);
    const files = stats.filter(([ , s ]) => !s.isDirectory());

    const items = await Promise.all(files.map(([f, s]) => this.getFileAndSizeAndHashForFile(buildDir, f, s)));

    return items.filter(item => item.href !== 'pro-manifest.json');
  }

@ionic/utils-array

Array utils

MIT
Latest version published 2 years ago

Package Health Score

64 / 100
Full package analysis

Similar packages