UNPKG

@yandex/themekit

Version:

Build system of design-tokens for any platforms

23 lines (22 loc) 881 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.glob = void 0; const fast_glob_1 = __importDefault(require("fast-glob")); const normalize_path_1 = __importDefault(require("normalize-path")); /** * Returns list of matched files by glob with normalized paths. * * @param pattern - Path with glob pattern. * @param exclude - Path for ignore. * @returns List of matched files. */ function glob(pattern, exclude) { // Use path normalize for correct using with glob on win systems. pattern = Array.isArray(pattern) ? pattern : [pattern]; pattern = pattern.map((path) => normalize_path_1.default(path)); return fast_glob_1.default.sync(pattern, { ignore: exclude }); } exports.glob = glob;