How to use the @ionic/utils-array.filter 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 / starters / src / utils / index.ts View on Github external
export async function getDirectories(p: string): Promise {
  const contents = await readdir(p);
  return filter(contents.map(f => path.resolve(p, f)), async f => (await stat(f)).isDirectory());
}
github ionic-team / ionic-cli / packages / ionic / src / lib / help.ts View on Github external
async getGlobalOptions(): Promise {
    const visibleOptions = await filter(GLOBAL_OPTIONS, async opt => isOptionVisible(opt));
    return visibleOptions.map(opt => formatOptionName(opt, { colors: NO_COLORS, showAliases: false }));
  }
github ionic-team / ionic-cli / packages / ionic / src / lib / integrations / cordova / project.ts View on Github external
export async function getPlatforms(projectDir: string): Promise {
  const platformsDir = path.resolve(projectDir, 'platforms');
  const contents = await readdirSafe(platformsDir);
  const platforms = await filter(contents, async file => {
    const stat = await statSafe(path.join(platformsDir, file));
    return !file.startsWith('.') && typeof stat !== 'undefined' && stat.isDirectory();
  });

  return platforms;
}

@ionic/utils-array

Array utils

MIT
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis

Similar packages