@navikt/aksel
Version:
Aksel command line interface. Handles css-imports, codemods and more
31 lines (30 loc) • 859 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GLOB_IGNORE_PATTERNS = void 0;
exports.getDefaultGlob = getDefaultGlob;
exports.cleanExtensions = cleanExtensions;
const GLOB_IGNORE_PATTERNS = [
"**/node_modules/**",
"**/dist/**",
"**/build/**",
"**/lib/**",
"**/.next/**",
"**/__snapshots__/**",
];
exports.GLOB_IGNORE_PATTERNS = GLOB_IGNORE_PATTERNS;
/**
* Utility function to generate the default glob pattern
*/
function getDefaultGlob(ext) {
const defaultExt = "js,ts,jsx,tsx,css,scss,less";
return `**/*.{${cleanExtensions(ext !== null && ext !== void 0 ? ext : defaultExt).join(",")}}`;
}
/**
* Utility function to clean file extensions
*/
function cleanExtensions(ext) {
return ext
.split(",")
.map((e) => e.trim())
.map((e) => e.replace(".", ""));
}