@stylable/node
Advanced tools
Comparing version 4.2.5 to 4.3.0
@@ -0,6 +1,7 @@ | ||
import type { IFileSystem } from '@file-services/types'; | ||
export declare type FileSystem = any; | ||
export declare function findFiles(fs: FileSystem, rootDirectory: string, ext: string, blacklist: Set<string>, useRelative?: boolean): { | ||
result: string[]; | ||
export declare function findFiles(fs: Pick<IFileSystem, 'readdirSync' | 'statSync'>, join: IFileSystem['join'], relative: IFileSystem['relative'], rootDirectory: string, ext: string, blacklist: Set<string>, useRelative?: boolean): { | ||
result: Set<string>; | ||
errors: Error[]; | ||
}; | ||
//# sourceMappingURL=find-files.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.findFiles = void 0; | ||
const path_1 = require("path"); | ||
function findFiles(fs, rootDirectory, ext, blacklist, useRelative = false) { | ||
function findFiles(fs, join, relative, rootDirectory, ext, blacklist, useRelative = false) { | ||
const errors = []; | ||
const result = []; | ||
const result = new Set(); | ||
const folders = [rootDirectory]; | ||
@@ -16,3 +15,3 @@ while (folders.length) { | ||
} | ||
const itemFullPath = path_1.join(current, item); | ||
const itemFullPath = join(current, item); | ||
try { | ||
@@ -24,3 +23,3 @@ const status = fs.statSync(itemFullPath); | ||
else if (status.isFile() && itemFullPath.endsWith(ext)) { | ||
result.push(useRelative ? path_1.relative(rootDirectory, itemFullPath) : itemFullPath); | ||
result.add(useRelative ? relative(rootDirectory, itemFullPath) : itemFullPath); | ||
} | ||
@@ -27,0 +26,0 @@ } |
{ | ||
"name": "@stylable/node", | ||
"version": "4.2.5", | ||
"version": "4.3.0", | ||
"description": "Integrate Stylable into your node application", | ||
@@ -10,4 +10,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@stylable/core": "^4.2.5", | ||
"@stylable/module-utils": "^4.2.5", | ||
"@stylable/core": "^4.3.0", | ||
"@stylable/module-utils": "^4.3.0", | ||
"find-config": "^1.0.0" | ||
@@ -14,0 +14,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
import { join, relative } from 'path'; | ||
import type { IFileSystem } from '@file-services/types'; | ||
@@ -6,3 +6,5 @@ export type FileSystem = any; | ||
export function findFiles( | ||
fs: FileSystem, | ||
fs: Pick<IFileSystem, 'readdirSync' | 'statSync'>, | ||
join: IFileSystem['join'], | ||
relative: IFileSystem['relative'], | ||
rootDirectory: string, | ||
@@ -14,3 +16,3 @@ ext: string, | ||
const errors: Error[] = []; | ||
const result: string[] = []; | ||
const result = new Set<string>(); | ||
const folders = [rootDirectory]; | ||
@@ -30,3 +32,3 @@ while (folders.length) { | ||
} else if (status.isFile() && itemFullPath.endsWith(ext)) { | ||
result.push( | ||
result.add( | ||
useRelative ? relative(rootDirectory, itemFullPath) : itemFullPath | ||
@@ -33,0 +35,0 @@ ); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
17912
231
Updated@stylable/core@^4.3.0