eslint-barrel-file-utils
Advanced tools
Comparing version 0.0.9 to 0.0.10
61
index.js
@@ -14,39 +14,44 @@ import { | ||
* exportConditions?: string[], | ||
* }} [options] | ||
* @returns {string} the resolved path to the module | ||
*/ | ||
* extensions?: string[], | ||
* }} [options] | ||
* @returns {string} the resolved path to the module | ||
*/ | ||
export function resolve(importer, importee, options) { | ||
const mainFields = options?.mainFields || ["module", "browser", "main"]; | ||
const exportConditions = options?.exportConditions || ["node", "import"]; | ||
const mainFields = options?.mainFields || ["module", "browser", "main"]; | ||
const exportConditions = options?.exportConditions || ["node", "import"]; | ||
const extensions = options?.extensions || [".js", ".ts", ".tsx", ".jsx", ".json", ".node"]; | ||
return resolve_rs(importer, importee, exportConditions, mainFields); | ||
return resolve_rs(importer, importee, exportConditions, mainFields, extensions); | ||
} | ||
/** | ||
* @param {string[]} entrypoints | ||
* @param {{ | ||
* basePath?: string, | ||
* exportConditions?: string[], | ||
* mainFields?: string[], | ||
* }} [options] | ||
* @returns {number} | ||
*/ | ||
* @param {string[]} entrypoints | ||
* @param {{ | ||
* basePath?: string, | ||
* exportConditions?: string[], | ||
* mainFields?: string[], | ||
* extensions?: string[], | ||
* }} [options] | ||
* @returns {number} | ||
*/ | ||
export function count_module_graph_size(entrypoints, options = {}) { | ||
const { | ||
basePath = process.cwd(), | ||
exportConditions = ["node", "import"], | ||
mainFields = ["module", "browser", "main"], | ||
} = options; | ||
const { | ||
basePath = process.cwd(), | ||
exportConditions = ["node", "import"], | ||
mainFields = ["module", "browser", "main"], | ||
extensions = [".js", ".ts", ".tsx", ".jsx", ".json", ".node"], | ||
} = options; | ||
const processedEntrypoints = (typeof entrypoints === "string" ? [entrypoints] : entrypoints); | ||
const result = count_module_graph_size_rs( | ||
processedEntrypoints, | ||
basePath, | ||
exportConditions, | ||
mainFields, | ||
builtinModules | ||
); | ||
return result; | ||
const processedEntrypoints = (typeof entrypoints === "string" ? [entrypoints] : entrypoints); | ||
const result = count_module_graph_size_rs( | ||
processedEntrypoints, | ||
basePath, | ||
exportConditions, | ||
mainFields, | ||
extensions, | ||
builtinModules | ||
); | ||
return result; | ||
} | ||
export { is_barrel_file }; |
{ | ||
"name": "eslint-barrel-file-utils", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Template project for writing node package with napi-rs", | ||
@@ -70,16 +70,16 @@ "main": "index.js", | ||
"optionalDependencies": { | ||
"eslint-barrel-file-utils-win32-x64-msvc": "0.0.9", | ||
"eslint-barrel-file-utils-darwin-x64": "0.0.9", | ||
"eslint-barrel-file-utils-linux-x64-gnu": "0.0.9", | ||
"eslint-barrel-file-utils-linux-x64-musl": "0.0.9", | ||
"eslint-barrel-file-utils-linux-arm64-gnu": "0.0.9", | ||
"eslint-barrel-file-utils-win32-ia32-msvc": "0.0.9", | ||
"eslint-barrel-file-utils-linux-arm-gnueabihf": "0.0.9", | ||
"eslint-barrel-file-utils-darwin-arm64": "0.0.9", | ||
"eslint-barrel-file-utils-android-arm64": "0.0.9", | ||
"eslint-barrel-file-utils-freebsd-x64": "0.0.9", | ||
"eslint-barrel-file-utils-linux-arm64-musl": "0.0.9", | ||
"eslint-barrel-file-utils-win32-arm64-msvc": "0.0.9", | ||
"eslint-barrel-file-utils-android-arm-eabi": "0.0.9" | ||
"eslint-barrel-file-utils-win32-x64-msvc": "0.0.10", | ||
"eslint-barrel-file-utils-darwin-x64": "0.0.10", | ||
"eslint-barrel-file-utils-linux-x64-gnu": "0.0.10", | ||
"eslint-barrel-file-utils-linux-x64-musl": "0.0.10", | ||
"eslint-barrel-file-utils-linux-arm64-gnu": "0.0.10", | ||
"eslint-barrel-file-utils-win32-ia32-msvc": "0.0.10", | ||
"eslint-barrel-file-utils-linux-arm-gnueabihf": "0.0.10", | ||
"eslint-barrel-file-utils-darwin-arm64": "0.0.10", | ||
"eslint-barrel-file-utils-android-arm64": "0.0.10", | ||
"eslint-barrel-file-utils-freebsd-x64": "0.0.10", | ||
"eslint-barrel-file-utils-linux-arm64-musl": "0.0.10", | ||
"eslint-barrel-file-utils-win32-arm64-msvc": "0.0.10", | ||
"eslint-barrel-file-utils-android-arm-eabi": "0.0.10" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
20146
404