@knighted/module 1.0.0 → 1.1.1

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.
Files changed (51) hide show
  1. package/README.md +4 -6
  2. package/dist/ast.d.ts +39 -0
  3. package/dist/cjs/ast.d.cts +39 -0
  4. package/dist/cjs/exports.d.cts +4 -1
  5. package/dist/cjs/format.cjs +70 -30
  6. package/dist/cjs/formatters/assignmentExpression.cjs +1 -1
  7. package/dist/cjs/formatters/identifier.cjs +2 -2
  8. package/dist/cjs/formatters/memberExpression.cjs +1 -1
  9. package/dist/cjs/helpers/ast.cjs +29 -0
  10. package/dist/cjs/helpers/identifier.cjs +5 -3
  11. package/dist/cjs/module.cjs +5 -4
  12. package/dist/cjs/specifier.cjs +1 -1
  13. package/dist/cjs/types.d.cts +2 -0
  14. package/dist/cjs/utils/exports.cjs +1 -1
  15. package/dist/cjs/utils/identifiers.cjs +2 -2
  16. package/dist/exports.d.ts +4 -1
  17. package/dist/format.js +70 -30
  18. package/dist/formatters/assignmentExpression.js +1 -1
  19. package/dist/formatters/identifier.js +2 -2
  20. package/dist/formatters/memberExpression.js +1 -1
  21. package/dist/helpers/ast.d.ts +39 -0
  22. package/dist/helpers/ast.js +18 -0
  23. package/dist/helpers/identifier.js +5 -4
  24. package/dist/module.js +6 -5
  25. package/dist/specifier.js +1 -1
  26. package/dist/types.d.ts +2 -0
  27. package/dist/{src/utils → utils}/exports.d.ts +4 -1
  28. package/dist/utils/exports.js +1 -1
  29. package/dist/utils/identifiers.js +2 -2
  30. package/package.json +9 -11
  31. package/dist/cjs/utils.cjs +0 -274
  32. package/dist/cjs/utils.d.cts +0 -23
  33. package/dist/src/format.d.ts +0 -9
  34. package/dist/src/module.d.ts +0 -3
  35. package/dist/src/parse.d.ts +0 -2
  36. package/dist/src/specifier.d.ts +0 -16
  37. package/dist/src/types.d.ts +0 -91
  38. package/dist/src/utils.d.ts +0 -23
  39. package/dist/src/walk.d.ts +0 -20
  40. package/dist/utils.d.ts +0 -23
  41. package/dist/utils.js +0 -265
  42. /package/dist/{src/formatters → formatters}/assignmentExpression.d.ts +0 -0
  43. /package/dist/{src/formatters → formatters}/expressionStatement.d.ts +0 -0
  44. /package/dist/{src/formatters → formatters}/identifier.d.ts +0 -0
  45. /package/dist/{src/formatters → formatters}/memberExpression.d.ts +0 -0
  46. /package/dist/{src/formatters → formatters}/metaProperty.d.ts +0 -0
  47. /package/dist/{src/helpers → helpers}/identifier.d.ts +0 -0
  48. /package/dist/{src/utils → utils}/identifiers.d.ts +0 -0
  49. /package/dist/{src/utils → utils}/lang.d.ts +0 -0
  50. /package/dist/{src/utils → utils}/scopeNodes.d.ts +0 -0
  51. /package/dist/{src/utils → utils}/url.d.ts +0 -0
@@ -1,274 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.requireMainRgx = exports.isValidUrl = exports.exportsRename = exports.collectScopeIdentifiers = exports.collectModuleIdentifiers = exports.collectCjsExports = void 0;
7
- var _walk = require("./walk.cjs");
8
- var _identifier = require("./helpers/identifier.cjs");
9
- var _scopeNodes = require("./utils/scopeNodes.cjs");
10
- const isValidUrl = url => {
11
- try {
12
- new URL(url);
13
- return true;
14
- } catch {
15
- return false;
16
- }
17
- };
18
- exports.isValidUrl = isValidUrl;
19
- const exportsRename = exports.exportsRename = '__exports';
20
- const requireMainRgx = exports.requireMainRgx = /(require\.main\s*===\s*module|module\s*===\s*require\.main)/g;
21
- const resolveExportTarget = node => {
22
- if (node.type !== 'MemberExpression') return null;
23
- const base = node.object;
24
- const prop = node.property;
25
- if (prop.type !== 'Identifier') return null;
26
- if (base.type === 'Identifier' && base.name === 'exports') {
27
- return {
28
- key: prop.name,
29
- via: 'exports'
30
- };
31
- }
32
- if (base.type === 'MemberExpression' && base.object.type === 'Identifier' && base.object.name === 'module' && base.property.type === 'Identifier' && base.property.name === 'exports') {
33
- return {
34
- key: prop.name,
35
- via: 'module.exports'
36
- };
37
- }
38
- if (base.type === 'Identifier' && base.name === 'module' && prop.type === 'Identifier' && prop.name === 'exports') {
39
- return {
40
- key: 'default',
41
- via: 'module.exports'
42
- };
43
- }
44
- return null;
45
- };
46
- const collectCjsExports = async ast => {
47
- const exportsMap = new Map();
48
- const localToExport = new Map();
49
- await (0, _walk.ancestorWalk)(ast, {
50
- enter(node) {
51
- if (node.type === 'AssignmentExpression') {
52
- const target = resolveExportTarget(node.left);
53
- if (target) {
54
- const entry = exportsMap.get(target.key) ?? {
55
- key: target.key,
56
- writes: [],
57
- via: new Set(),
58
- reassignments: []
59
- };
60
- entry.via.add(target.via);
61
- entry.writes.push(node);
62
- if (node.right.type === 'Identifier') {
63
- entry.fromIdentifier ??= node.right.name;
64
- if (entry.fromIdentifier) {
65
- const set = localToExport.get(entry.fromIdentifier) ?? new Set();
66
- set.add(target.key);
67
- localToExport.set(entry.fromIdentifier, set);
68
- }
69
- }
70
- exportsMap.set(target.key, entry);
71
- return;
72
- }
73
- if (node.left.type === 'Identifier') {
74
- const keys = localToExport.get(node.left.name);
75
- if (keys) {
76
- keys.forEach(key => {
77
- const entry = exportsMap.get(key);
78
- if (entry) {
79
- entry.reassignments.push(node);
80
- exportsMap.set(key, entry);
81
- }
82
- });
83
- }
84
- }
85
- }
86
- }
87
- });
88
- return exportsMap;
89
- };
90
- exports.collectCjsExports = collectCjsExports;
91
- const collectScopeIdentifiers = (node, scopes) => {
92
- const {
93
- type
94
- } = node;
95
- switch (type) {
96
- case 'BlockStatement':
97
- case 'ClassBody':
98
- scopes.push({
99
- node,
100
- type: 'Block',
101
- name: type,
102
- idents: new Set()
103
- });
104
- break;
105
- case 'FunctionDeclaration':
106
- case 'FunctionExpression':
107
- case 'ArrowFunctionExpression':
108
- {
109
- const name = node.id ? node.id.name : 'anonymous';
110
- const scope = {
111
- node,
112
- name,
113
- type: 'Function',
114
- idents: new Set()
115
- };
116
- node.params.map(param => {
117
- if (param.type === 'TSParameterProperty') {
118
- return param.parameter;
119
- }
120
- if (param.type === 'RestElement') {
121
- return param.argument;
122
- }
123
- if (param.type === 'AssignmentPattern') {
124
- return param.left;
125
- }
126
- return param;
127
- }).filter(_identifier.identifier.isNamed).forEach(param => {
128
- scope.idents.add(param.name);
129
- });
130
-
131
- /**
132
- * If a FunctionExpression has an id, it is a named function expression.
133
- * The function expression name shadows the module scope identifier, so
134
- * we don't want to count reads of module identifers that have the same name.
135
- * They also do not cause a SyntaxError if the function expression name is
136
- * the same as a module scope identifier.
137
- *
138
- * TODO: Is this necessary for FunctionDeclaration?
139
- */
140
- if (node.type === 'FunctionExpression' && node.id) {
141
- scope.idents.add(node.id.name);
142
- }
143
-
144
- // First add the function to any previous scopes
145
- if (scopes.length > 0) {
146
- scopes[scopes.length - 1].idents.add(name);
147
- }
148
-
149
- // Then add the function scope to the scopes stack
150
- scopes.push(scope);
151
- }
152
- break;
153
- case 'ClassDeclaration':
154
- {
155
- const className = node.id ? node.id.name : 'anonymous';
156
-
157
- // First add the class to any previous scopes
158
- if (scopes.length > 0) {
159
- scopes[scopes.length - 1].idents.add(className);
160
- }
161
-
162
- // Then add the class to the scopes stack
163
- scopes.push({
164
- node,
165
- name: className,
166
- type: 'Class',
167
- idents: new Set()
168
- });
169
- }
170
- break;
171
- case 'ClassExpression':
172
- {}
173
- break;
174
- case 'VariableDeclaration':
175
- if (scopes.length > 0) {
176
- const scope = scopes[scopes.length - 1];
177
- node.declarations.forEach(decl => {
178
- if (decl.type === 'VariableDeclarator' && decl.id.type === 'Identifier') {
179
- scope.idents.add(decl.id.name);
180
- }
181
- });
182
- }
183
- break;
184
- }
185
- };
186
-
187
- /**
188
- * Collects all module scope identifiers in the AST.
189
- *
190
- * Ignores identifiers that are in functions or classes.
191
- * Ignores new scopes for StaticBlock nodes (can only reference static class members).
192
- *
193
- * Special case handling for these which create their own scopes,
194
- * but are also valid module scope identifiers:
195
- * - ClassDeclaration
196
- * - FunctionDeclaration
197
- *
198
- * Special case handling for var inside BlockStatement
199
- * which are also valid module scope identifiers.
200
- */
201
- exports.collectScopeIdentifiers = collectScopeIdentifiers;
202
- const collectModuleIdentifiers = async (ast, hoisting = true) => {
203
- const identifiers = new Map();
204
- const globalReads = new Map();
205
- const scopes = [];
206
- await (0, _walk.ancestorWalk)(ast, {
207
- enter(node, ancestors) {
208
- const {
209
- type
210
- } = node;
211
- collectScopeIdentifiers(node, scopes);
212
-
213
- // Add module scope identifiers to the registry map
214
-
215
- if (type === 'Identifier') {
216
- const {
217
- name
218
- } = node;
219
- const meta = identifiers.get(name) ?? {
220
- declare: [],
221
- read: []
222
- };
223
- const isDeclaration = _identifier.identifier.isDeclaration(ancestors);
224
- const inScope = scopes.some(scope => scope.idents.has(name) || scope.name === name);
225
- if (hoisting && !_identifier.identifier.isDeclaration(ancestors) && !_identifier.identifier.isFunctionExpressionId(ancestors) && !_identifier.identifier.isExportSpecifierAlias(ancestors) && !_identifier.identifier.isClassPropertyKey(ancestors) && !_identifier.identifier.isMethodDefinitionKey(ancestors) && !_identifier.identifier.isMemberKey(ancestors) && !_identifier.identifier.isPropertyKey(ancestors) && !_identifier.identifier.isIife(ancestors) && !inScope) {
226
- if (globalReads.has(name)) {
227
- globalReads.get(name)?.push(node);
228
- } else {
229
- globalReads.set(name, [node]);
230
- }
231
- }
232
- if (isDeclaration) {
233
- const isModuleScope = _identifier.identifier.isModuleScope(ancestors);
234
- const isClassOrFuncDeclaration = _identifier.identifier.isClassOrFuncDeclarationId(ancestors);
235
- const isVarDeclarationInGlobalScope = _identifier.identifier.isVarDeclarationInGlobalScope(ancestors);
236
- const parent = ancestors[ancestors.length - 2];
237
- const grandParent = ancestors[ancestors.length - 3];
238
- const hoistSafe = parent.type === 'FunctionDeclaration' || parent.type === 'VariableDeclarator' && grandParent?.type === 'VariableDeclaration' && grandParent.kind === 'var';
239
- if (isModuleScope || isClassOrFuncDeclaration || isVarDeclarationInGlobalScope) {
240
- meta.declare.push(node);
241
-
242
- // Check for hoisted reads
243
- if (hoisting && hoistSafe && globalReads.has(name)) {
244
- const reads = globalReads.get(name);
245
- if (reads) {
246
- reads.forEach(read => {
247
- if (!meta.read.includes(read)) {
248
- meta.read.push(read);
249
- }
250
- });
251
- }
252
- }
253
- identifiers.set(name, meta);
254
- }
255
- } else {
256
- if (identifiers.has(name) && !inScope && !_identifier.identifier.isIife(ancestors) && !_identifier.identifier.isFunctionExpressionId(ancestors) && !_identifier.identifier.isExportSpecifierAlias(ancestors) && !_identifier.identifier.isClassPropertyKey(ancestors) && !_identifier.identifier.isMethodDefinitionKey(ancestors) && !_identifier.identifier.isMemberKey(ancestors) && !_identifier.identifier.isPropertyKey(ancestors)) {
257
- // Closure is referencing module scope identifier
258
- meta.read.push(node);
259
- }
260
- }
261
- }
262
- },
263
- leave(node) {
264
- const {
265
- type
266
- } = node;
267
- if (_scopeNodes.scopeNodes.includes(type)) {
268
- scopes.pop();
269
- }
270
- }
271
- });
272
- return identifiers;
273
- };
274
- exports.collectModuleIdentifiers = collectModuleIdentifiers;
@@ -1,23 +0,0 @@
1
- import type { Node } from 'oxc-parser';
2
- import type { IdentMeta, Scope, CjsExport } from './types.cjs';
3
- declare const isValidUrl: (url: string) => boolean;
4
- declare const exportsRename = "__exports";
5
- declare const requireMainRgx: RegExp;
6
- declare const collectCjsExports: (ast: Node) => Promise<Map<string, CjsExport>>;
7
- declare const collectScopeIdentifiers: (node: Node, scopes: Scope[]) => void;
8
- /**
9
- * Collects all module scope identifiers in the AST.
10
- *
11
- * Ignores identifiers that are in functions or classes.
12
- * Ignores new scopes for StaticBlock nodes (can only reference static class members).
13
- *
14
- * Special case handling for these which create their own scopes,
15
- * but are also valid module scope identifiers:
16
- * - ClassDeclaration
17
- * - FunctionDeclaration
18
- *
19
- * Special case handling for var inside BlockStatement
20
- * which are also valid module scope identifiers.
21
- */
22
- declare const collectModuleIdentifiers: (ast: Node, hoisting?: boolean) => Promise<Map<string, IdentMeta>>;
23
- export { isValidUrl, collectScopeIdentifiers, collectModuleIdentifiers, collectCjsExports, exportsRename, requireMainRgx, };
@@ -1,9 +0,0 @@
1
- import type { ParseResult } from 'oxc-parser';
2
- import type { FormatterOptions } from './types.js';
3
- /**
4
- * Node added support for import.meta.main.
5
- * Added in: v24.2.0, v22.18.0
6
- * @see https://nodejs.org/api/esm.html#importmetamain
7
- */
8
- declare const format: (src: string, ast: ParseResult, opts: FormatterOptions) => Promise<string>;
9
- export { format };
@@ -1,3 +0,0 @@
1
- import type { ModuleOptions } from './types.js';
2
- declare const transform: (filename: string, options?: ModuleOptions) => Promise<string>;
3
- export { transform };
@@ -1,2 +0,0 @@
1
- declare const parse: (filename: string, code: string) => import("oxc-parser").ParseResult;
2
- export { parse };
@@ -1,16 +0,0 @@
1
- import type { ParserOptions, StringLiteral, TemplateLiteral, BinaryExpression, NewExpression, ImportDeclaration, ExportNamedDeclaration, ExportAllDeclaration, TSImportType, ImportExpression, CallExpression } from 'oxc-parser';
2
- type Spec = {
3
- type: 'StringLiteral' | 'TemplateLiteral' | 'BinaryExpression' | 'NewExpression';
4
- node: StringLiteral | TemplateLiteral | BinaryExpression | NewExpression;
5
- parent: CallExpression | ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpression | TSImportType;
6
- start: number;
7
- end: number;
8
- value: string;
9
- };
10
- type Callback = (spec: Spec) => string | void;
11
- declare const specifier: {
12
- update(path: string, callback: Callback): Promise<string>;
13
- updateSrc(src: string, lang: ParserOptions["lang"], callback: Callback): Promise<string>;
14
- };
15
- export { specifier };
16
- export type { Spec, Callback };
@@ -1,91 +0,0 @@
1
- import type { Node, Span, IdentifierName, IdentifierReference, BindingIdentifier, LabelIdentifier, TSIndexSignatureName } from 'oxc-parser';
2
- export type RewriteSpecifier = '.js' | '.mjs' | '.cjs' | '.ts' | '.mts' | '.cts' | ((value: string) => string | null | undefined);
3
- /** Options that control how modules are parsed, transformed, and emitted. */
4
- export type ModuleOptions = {
5
- /** Output format to emit. */
6
- target: 'module' | 'commonjs';
7
- /** Explicit source type; auto infers from file extension. */
8
- sourceType?: 'auto' | 'module' | 'commonjs';
9
- /**
10
- * Enable syntax transforms beyond parsing.
11
- * - true: full CJS↔ESM lowering/raising
12
- * - 'globals-only': rewrite module-global differences (import.meta, __dirname/filename, require.main shims) while leaving import/export shapes untouched
13
- * - false/undefined: no syntax transforms
14
- */
15
- transformSyntax?: boolean | 'globals-only';
16
- /** How to emit live bindings for ESM exports. */
17
- liveBindings?: 'strict' | 'loose' | 'off';
18
- /** Rewrite import specifiers (e.g. add extensions). */
19
- rewriteSpecifier?: RewriteSpecifier;
20
- /** Whether to append .js to relative imports. */
21
- appendJsExtension?: 'off' | 'relative-only' | 'all';
22
- /** Add directory index (e.g. /index.js) or disable. */
23
- appendDirectoryIndex?: string | false;
24
- /** Precedence: rewriteSpecifier runs first; if it returns a string that wins. If it returns undefined or null, appenders apply. Bare specifiers are never modified by appenders. */
25
- /** Control __dirname/__filename handling (inject shims, preserve existing, or throw on use). */
26
- dirFilename?: 'inject' | 'preserve' | 'error';
27
- /** How to treat import.meta. */
28
- importMeta?: 'preserve' | 'shim' | 'error';
29
- /** Strategy for import.meta.main emulation. */
30
- importMetaMain?: 'shim' | 'warn' | 'error';
31
- /** Resolution strategy for detecting the main module. */
32
- requireMainStrategy?: 'import-meta-main' | 'realpath';
33
- /** Detect circular require usage level. */
34
- detectCircularRequires?: 'off' | 'warn' | 'error';
35
- /** Source used to provide require in ESM output. */
36
- requireSource?: 'builtin' | 'create-require';
37
- /** How to rewrite nested or non-hoistable require calls. */
38
- nestedRequireStrategy?: 'create-require' | 'dynamic-import';
39
- /** Default interop style for CommonJS default imports. */
40
- cjsDefault?: 'module-exports' | 'auto' | 'none';
41
- /** Emit idiomatic exports when raising CJS to ESM. */
42
- idiomaticExports?: 'off' | 'safe' | 'aggressive';
43
- /** Handling for top-level await constructs. */
44
- topLevelAwait?: 'error' | 'wrap' | 'preserve';
45
- /** Optional diagnostics sink for warnings/errors emitted during transform. */
46
- diagnostics?: (diag: Diagnostic) => void;
47
- /** Optional source file path used for diagnostics context. */
48
- filePath?: string;
49
- /** Output directory or file path when writing. */
50
- out?: string;
51
- /** Overwrite input files instead of writing to out. */
52
- inPlace?: boolean;
53
- };
54
- export type Diagnostic = {
55
- level: 'warning' | 'error';
56
- code: string;
57
- message: string;
58
- filePath?: string;
59
- loc?: {
60
- start: number;
61
- end: number;
62
- };
63
- };
64
- export type SpannedNode = Node & Span;
65
- export type ExportsMeta = {
66
- hasExportsBeenReassigned: boolean;
67
- hasDefaultExportBeenReassigned: boolean;
68
- hasDefaultExportBeenAssigned: boolean;
69
- defaultExportValue: unknown;
70
- };
71
- export type CjsExport = {
72
- key: string;
73
- writes: SpannedNode[];
74
- fromIdentifier?: string;
75
- via: Set<'exports' | 'module.exports'>;
76
- reassignments: SpannedNode[];
77
- hasGetter?: boolean;
78
- hasNonTopLevelWrite?: boolean;
79
- };
80
- export type IdentMeta = {
81
- declare: SpannedNode[];
82
- read: SpannedNode[];
83
- };
84
- export type Scope = {
85
- type: string;
86
- name: string;
87
- node: Node;
88
- idents: Set<string>;
89
- };
90
- export type FormatterOptions = Omit<ModuleOptions, 'out' | 'inPlace'>;
91
- export type Identifier = IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | TSIndexSignatureName;
@@ -1,23 +0,0 @@
1
- import type { Node } from 'oxc-parser';
2
- import type { IdentMeta, Scope, CjsExport } from './types.js';
3
- declare const isValidUrl: (url: string) => boolean;
4
- declare const exportsRename = "__exports";
5
- declare const requireMainRgx: RegExp;
6
- declare const collectCjsExports: (ast: Node) => Promise<Map<string, CjsExport>>;
7
- declare const collectScopeIdentifiers: (node: Node, scopes: Scope[]) => void;
8
- /**
9
- * Collects all module scope identifiers in the AST.
10
- *
11
- * Ignores identifiers that are in functions or classes.
12
- * Ignores new scopes for StaticBlock nodes (can only reference static class members).
13
- *
14
- * Special case handling for these which create their own scopes,
15
- * but are also valid module scope identifiers:
16
- * - ClassDeclaration
17
- * - FunctionDeclaration
18
- *
19
- * Special case handling for var inside BlockStatement
20
- * which are also valid module scope identifiers.
21
- */
22
- declare const collectModuleIdentifiers: (ast: Node, hoisting?: boolean) => Promise<Map<string, IdentMeta>>;
23
- export { isValidUrl, collectScopeIdentifiers, collectModuleIdentifiers, collectCjsExports, exportsRename, requireMainRgx, };
@@ -1,20 +0,0 @@
1
- import type { Node } from 'oxc-parser';
2
- /**
3
- * Using visitorKeys instead of oxc Visitor to keep
4
- * an ancestor-aware enter/leave API with this.skip()
5
- * without per-node method boilerplate.
6
- */
7
- type AncestorContext = {
8
- skip: () => void;
9
- };
10
- type AncestorVisitor = {
11
- enter?: (this: AncestorContext, node: Node, ancestors: Node[]) => void | Promise<void>;
12
- leave?: (this: AncestorContext, node: Node, ancestors: Node[]) => void | Promise<void>;
13
- };
14
- type WalkVisitor = {
15
- enter?: (this: AncestorContext, node: Node, parent: Node | null) => void | Promise<void>;
16
- leave?: (this: AncestorContext, node: Node, parent: Node | null) => void | Promise<void>;
17
- };
18
- declare const ancestorWalk: (node: Node, visitors: AncestorVisitor) => Promise<void>;
19
- declare const walk: (node: Node, visitors: WalkVisitor) => Promise<void>;
20
- export { ancestorWalk, walk };
package/dist/utils.d.ts DELETED
@@ -1,23 +0,0 @@
1
- import type { Node } from 'oxc-parser';
2
- import type { IdentMeta, Scope, CjsExport } from './types.js';
3
- declare const isValidUrl: (url: string) => boolean;
4
- declare const exportsRename = "__exports";
5
- declare const requireMainRgx: RegExp;
6
- declare const collectCjsExports: (ast: Node) => Promise<Map<string, CjsExport>>;
7
- declare const collectScopeIdentifiers: (node: Node, scopes: Scope[]) => void;
8
- /**
9
- * Collects all module scope identifiers in the AST.
10
- *
11
- * Ignores identifiers that are in functions or classes.
12
- * Ignores new scopes for StaticBlock nodes (can only reference static class members).
13
- *
14
- * Special case handling for these which create their own scopes,
15
- * but are also valid module scope identifiers:
16
- * - ClassDeclaration
17
- * - FunctionDeclaration
18
- *
19
- * Special case handling for var inside BlockStatement
20
- * which are also valid module scope identifiers.
21
- */
22
- declare const collectModuleIdentifiers: (ast: Node, hoisting?: boolean) => Promise<Map<string, IdentMeta>>;
23
- export { isValidUrl, collectScopeIdentifiers, collectModuleIdentifiers, collectCjsExports, exportsRename, requireMainRgx, };