@stylable/core
Advanced tools
Comparing version 5.3.0-rc.1 to 5.3.0
@@ -93,10 +93,4 @@ import { Diagnostics } from '../diagnostics'; | ||
declare type ImportPatch = Partial<Pick<Imported, 'defaultExport' | 'named' | 'keyframes'>> & Pick<Imported, 'request'>; | ||
declare type ImportEvent = { | ||
context: string; | ||
request: string; | ||
resolved: string; | ||
depth: number; | ||
}; | ||
export declare function tryCollectImportsDeep(stylable: Stylable, meta: StylableMeta, imports?: Set<string>, onImport?: undefined | ((e: ImportEvent) => void), depth?: number): Set<string>; | ||
export declare function tryCollectImportsDeep(stylable: Stylable, meta: StylableMeta, imports?: Set<string>): Set<string>; | ||
export {}; | ||
//# sourceMappingURL=import.d.ts.map |
@@ -434,10 +434,9 @@ "use strict"; | ||
} | ||
function tryCollectImportsDeep(stylable, meta, imports = new Set(), onImport = undefined, depth = 0) { | ||
function tryCollectImportsDeep(stylable, meta, imports = new Set()) { | ||
for (const { context, request } of meta.getImportStatements()) { | ||
try { | ||
const resolved = stylable.resolver.resolvePath(context, request); | ||
onImport === null || onImport === void 0 ? void 0 : onImport({ context, request, resolved, depth }); | ||
if (!imports.has(resolved)) { | ||
imports.add(resolved); | ||
tryCollectImportsDeep(stylable, stylable.analyze(resolved), imports, onImport, depth + 1); | ||
tryCollectImportsDeep(stylable, stylable.analyze(resolved), imports); | ||
} | ||
@@ -444,0 +443,0 @@ } |
{ | ||
"name": "@stylable/core", | ||
"version": "5.3.0-rc.1", | ||
"version": "5.3.0", | ||
"description": "CSS for Components", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -583,15 +583,6 @@ import path from 'path'; | ||
type ImportEvent = { | ||
context: string; | ||
request: string; | ||
resolved: string; | ||
depth: number; | ||
}; | ||
export function tryCollectImportsDeep( | ||
stylable: Stylable, | ||
meta: StylableMeta, | ||
imports = new Set<string>(), | ||
onImport: undefined | ((e: ImportEvent) => void) = undefined, | ||
depth = 0 | ||
imports = new Set<string>() | ||
) { | ||
@@ -601,13 +592,6 @@ for (const { context, request } of meta.getImportStatements()) { | ||
const resolved = stylable.resolver.resolvePath(context, request); | ||
onImport?.({ context, request, resolved, depth }); | ||
if (!imports.has(resolved)) { | ||
imports.add(resolved); | ||
tryCollectImportsDeep( | ||
stylable, | ||
stylable.analyze(resolved), | ||
imports, | ||
onImport, | ||
depth + 1 | ||
); | ||
tryCollectImportsDeep(stylable, stylable.analyze(resolved), imports); | ||
} | ||
@@ -614,0 +598,0 @@ } catch (e) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
1099060
19669