How to use the fast-glob.isDynamicPattern function in fast-glob

To help you get started, we’ve selected a few fast-glob 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 ryanelian / instapack / bin / CopyBuildTool.js View on Github external
}
                try {
                    const fileStats = yield fse.lstat(absoluteFilePath);
                    if (fileStats.isFile()) {
                        globs.push(FastGlob.escapePath(relativeFilePath));
                    }
                    else if (fileStats.isDirectory()) {
                        const globbedPath = upath.join(FastGlob.escapePath(relativeFilePath), '**');
                        globs.push(globbedPath);
                    }
                    else {
                        Shout_1.Shout.warning(`Copy skip: ${absoluteFilePath} is neither a file nor a folder?!`);
                    }
                }
                catch (e) {
                    if (FastGlob.isDynamicPattern(relativeFilePath)) {
                        globs.push(relativeFilePath);
                    }
                }
            }
            const assets = yield FastGlob(globs, {
                cwd: libraryPath
            });
            const commonPath = this.findCommonParentFolderPath(assets);
            for (const asset of assets) {
                const absoluteFilePath = upath.join(libraryPath, asset);
                const relativeFilePath = upath.relative(commonPath, asset);
                const targetFilePath = upath.join(targetPath, relativeFilePath);
                const task = this.tryCopyFile(absoluteFilePath, targetFilePath, overwrite);
                tasks.push(task);
            }
            const success = yield Promise.all(tasks);
github sindresorhus / globby / index.js View on Github external
	.some(pattern => fastGlob.isDynamicPattern(pattern, options));

fast-glob

It's a very fast and efficient glob library for Node.js

MIT
Latest version published 1 year ago

Package Health Score

83 / 100
Full package analysis