@bamboocss/vite 1.46.3 → 1.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fold-module.cjs +1 -1
- package/dist/fold-module.mjs +1 -1
- package/dist/index.cjs +512 -222
- package/dist/index.d.cts +6 -10
- package/dist/index.d.mts +8 -10
- package/dist/index.mjs +512 -222
- package/package.json +9 -9
package/dist/fold-module.cjs
CHANGED
|
@@ -2378,7 +2378,7 @@ const foldSource = (options) => {
|
|
|
2378
2378
|
const definition = entry?.box?.getNode?.();
|
|
2379
2379
|
const nameNode = definition?.getSourceFile() === sourceFile ? definition?.getFirstAncestorByKind(ts_morph.SyntaxKind.VariableDeclaration)?.getNameNode() : importSpecifierFor(sourceFile, binding);
|
|
2380
2380
|
if (!nameNode || !ts_morph.Node.isIdentifier(nameNode)) continue;
|
|
2381
|
-
const references = localReferencesTo(identifiersByName(), binding, nameNode);
|
|
2381
|
+
const references = localReferencesTo(identifiersByName(), binding, nameNode).filter((reference) => !reference.getFirstAncestorByKind(ts_morph.SyntaxKind.TypeQuery));
|
|
2382
2382
|
if (skipped.filter((item) => SURVIVES_TO_RUNTIME.has(item.reason) && item.end > item.start).some((item) => references.some((ref) => ref.getStart() >= item.start && ref.getStart() < item.end))) continue;
|
|
2383
2383
|
const survivor = references.find((ref) => !applied.some(([from, to]) => ref.getStart() >= from && ref.getStart() < to));
|
|
2384
2384
|
if (!survivor) continue;
|
package/dist/fold-module.mjs
CHANGED
|
@@ -2376,7 +2376,7 @@ const foldSource = (options) => {
|
|
|
2376
2376
|
const definition = entry?.box?.getNode?.();
|
|
2377
2377
|
const nameNode = definition?.getSourceFile() === sourceFile ? definition?.getFirstAncestorByKind(SyntaxKind.VariableDeclaration)?.getNameNode() : importSpecifierFor(sourceFile, binding);
|
|
2378
2378
|
if (!nameNode || !Node.isIdentifier(nameNode)) continue;
|
|
2379
|
-
const references = localReferencesTo(identifiersByName(), binding, nameNode);
|
|
2379
|
+
const references = localReferencesTo(identifiersByName(), binding, nameNode).filter((reference) => !reference.getFirstAncestorByKind(SyntaxKind.TypeQuery));
|
|
2380
2380
|
if (skipped.filter((item) => SURVIVES_TO_RUNTIME.has(item.reason) && item.end > item.start).some((item) => references.some((ref) => ref.getStart() >= item.start && ref.getStart() < item.end))) continue;
|
|
2381
2381
|
const survivor = references.find((ref) => !applied.some(([from, to]) => ref.getStart() >= from && ref.getStart() < to));
|
|
2382
2382
|
if (!survivor) continue;
|