@knighted/module 1.0.0-alpha.9 → 1.0.0-beta.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 (85) hide show
  1. package/README.md +28 -16
  2. package/dist/assignmentExpression.d.ts +12 -0
  3. package/dist/cjs/assignmentExpression.d.cts +12 -0
  4. package/dist/cjs/exports.d.cts +6 -0
  5. package/dist/cjs/expressionStatement.d.cts +2 -3
  6. package/dist/cjs/format.cjs +133 -26
  7. package/dist/cjs/format.d.cts +6 -6
  8. package/dist/cjs/formatters/assignmentExpression.cjs +37 -0
  9. package/dist/cjs/formatters/expressionStatement.cjs +36 -55
  10. package/dist/cjs/formatters/identifier.cjs +31 -31
  11. package/dist/cjs/formatters/memberExpression.cjs +24 -11
  12. package/dist/cjs/formatters/metaProperty.cjs +23 -35
  13. package/dist/cjs/helpers/identifier.cjs +132 -0
  14. package/dist/cjs/helpers/scope.cjs +12 -0
  15. package/dist/cjs/identifier.d.cts +31 -5
  16. package/dist/cjs/identifiers.d.cts +19 -0
  17. package/dist/cjs/lang.d.cts +4 -0
  18. package/dist/cjs/memberExpression.d.cts +2 -3
  19. package/dist/cjs/metaProperty.d.cts +2 -3
  20. package/dist/cjs/module.cjs +26 -27
  21. package/dist/cjs/parse.cjs +3 -14
  22. package/dist/cjs/parse.d.cts +1 -1
  23. package/dist/cjs/scope.d.cts +6 -0
  24. package/dist/cjs/types.d.cts +40 -4
  25. package/dist/cjs/url.d.cts +2 -0
  26. package/dist/cjs/utils/exports.cjs +227 -0
  27. package/dist/cjs/utils/identifiers.cjs +190 -0
  28. package/dist/cjs/utils/lang.cjs +25 -0
  29. package/dist/cjs/utils/url.cjs +16 -0
  30. package/dist/cjs/utils.cjs +288 -0
  31. package/dist/cjs/utils.d.cts +26 -0
  32. package/dist/cjs/walk.cjs +75 -0
  33. package/dist/cjs/walk.d.cts +20 -0
  34. package/dist/exports.d.ts +6 -0
  35. package/dist/expressionStatement.d.ts +2 -3
  36. package/dist/format.d.ts +6 -6
  37. package/dist/format.js +135 -27
  38. package/dist/formatters/assignmentExpression.js +30 -0
  39. package/dist/formatters/expressionStatement.js +36 -55
  40. package/dist/formatters/identifier.js +31 -31
  41. package/dist/formatters/memberExpression.js +24 -11
  42. package/dist/formatters/metaProperty.js +23 -35
  43. package/dist/helpers/identifier.js +127 -0
  44. package/dist/helpers/scope.js +7 -0
  45. package/dist/identifier.d.ts +31 -5
  46. package/dist/identifiers.d.ts +19 -0
  47. package/dist/lang.d.ts +4 -0
  48. package/dist/memberExpression.d.ts +2 -3
  49. package/dist/metaProperty.d.ts +2 -3
  50. package/dist/module.js +26 -27
  51. package/dist/parse.d.ts +1 -1
  52. package/dist/parse.js +3 -14
  53. package/dist/scope.d.ts +6 -0
  54. package/dist/src/format.d.ts +9 -0
  55. package/dist/src/formatters/assignmentExpression.d.ts +12 -0
  56. package/dist/src/formatters/expressionStatement.d.ts +4 -0
  57. package/dist/src/formatters/identifier.d.ts +12 -0
  58. package/dist/src/formatters/memberExpression.d.ts +4 -0
  59. package/dist/src/formatters/metaProperty.d.ts +4 -0
  60. package/dist/src/helpers/identifier.d.ts +31 -0
  61. package/dist/src/helpers/scope.d.ts +6 -0
  62. package/dist/src/module.d.ts +3 -0
  63. package/dist/src/parse.d.ts +2 -0
  64. package/dist/src/types.d.ts +43 -0
  65. package/dist/src/utils/exports.d.ts +6 -0
  66. package/dist/src/utils/identifiers.d.ts +19 -0
  67. package/dist/src/utils/lang.d.ts +4 -0
  68. package/dist/src/utils/url.d.ts +2 -0
  69. package/dist/src/utils.d.ts +26 -0
  70. package/dist/src/walk.d.ts +20 -0
  71. package/dist/types.d.ts +40 -4
  72. package/dist/url.d.ts +2 -0
  73. package/dist/utils/exports.js +221 -0
  74. package/dist/utils/identifiers.js +183 -0
  75. package/dist/utils/lang.js +20 -0
  76. package/dist/utils/url.js +10 -0
  77. package/dist/utils.d.ts +26 -0
  78. package/dist/utils.js +278 -0
  79. package/dist/walk.d.ts +20 -0
  80. package/dist/walk.js +69 -0
  81. package/package.json +43 -25
  82. package/dist/formatters/expressionStatement.d.ts +0 -5
  83. package/dist/formatters/identifier.d.ts +0 -5
  84. package/dist/formatters/memberExpression.d.ts +0 -5
  85. package/dist/formatters/metaProperty.d.ts +0 -5
package/dist/utils.js ADDED
@@ -0,0 +1,278 @@
1
+ import { extname } from 'node:path';
2
+ import { ancestorWalk } from './walk.js';
3
+ import { scopes as scopeNodes } from './helpers/scope.js';
4
+ import { identifier } from './helpers/identifier.js';
5
+ const getLangFromExt = filename => {
6
+ const ext = extname(filename);
7
+ if (ext.endsWith('.js')) {
8
+ return 'js';
9
+ }
10
+ if (ext.endsWith('.ts')) {
11
+ return 'ts';
12
+ }
13
+ if (ext === '.tsx') {
14
+ return 'tsx';
15
+ }
16
+ if (ext === '.jsx') {
17
+ return 'jsx';
18
+ }
19
+ };
20
+ const isValidUrl = url => {
21
+ try {
22
+ new URL(url);
23
+ return true;
24
+ } catch {
25
+ return false;
26
+ }
27
+ };
28
+ const exportsRename = '__exports';
29
+ const requireMainRgx = /(require\.main\s*===\s*module|module\s*===\s*require\.main)/g;
30
+ const resolveExportTarget = node => {
31
+ if (node.type !== 'MemberExpression') return null;
32
+ const base = node.object;
33
+ const prop = node.property;
34
+ if (prop.type !== 'Identifier') return null;
35
+ if (base.type === 'Identifier' && base.name === 'exports') {
36
+ return {
37
+ key: prop.name,
38
+ via: 'exports'
39
+ };
40
+ }
41
+ if (base.type === 'MemberExpression' && base.object.type === 'Identifier' && base.object.name === 'module' && base.property.type === 'Identifier' && base.property.name === 'exports') {
42
+ return {
43
+ key: prop.name,
44
+ via: 'module.exports'
45
+ };
46
+ }
47
+ if (base.type === 'Identifier' && base.name === 'module' && prop.type === 'Identifier' && prop.name === 'exports') {
48
+ return {
49
+ key: 'default',
50
+ via: 'module.exports'
51
+ };
52
+ }
53
+ return null;
54
+ };
55
+ const collectCjsExports = async ast => {
56
+ const exportsMap = new Map();
57
+ const localToExport = new Map();
58
+ await ancestorWalk(ast, {
59
+ enter(node) {
60
+ if (node.type === 'AssignmentExpression') {
61
+ const target = resolveExportTarget(node.left);
62
+ if (target) {
63
+ const entry = exportsMap.get(target.key) ?? {
64
+ key: target.key,
65
+ writes: [],
66
+ via: new Set(),
67
+ reassignments: []
68
+ };
69
+ entry.via.add(target.via);
70
+ entry.writes.push(node);
71
+ if (node.right.type === 'Identifier') {
72
+ entry.fromIdentifier ??= node.right.name;
73
+ if (entry.fromIdentifier) {
74
+ const set = localToExport.get(entry.fromIdentifier) ?? new Set();
75
+ set.add(target.key);
76
+ localToExport.set(entry.fromIdentifier, set);
77
+ }
78
+ }
79
+ exportsMap.set(target.key, entry);
80
+ return;
81
+ }
82
+ if (node.left.type === 'Identifier') {
83
+ const keys = localToExport.get(node.left.name);
84
+ if (keys) {
85
+ keys.forEach(key => {
86
+ const entry = exportsMap.get(key);
87
+ if (entry) {
88
+ entry.reassignments.push(node);
89
+ exportsMap.set(key, entry);
90
+ }
91
+ });
92
+ }
93
+ }
94
+ }
95
+ }
96
+ });
97
+ return exportsMap;
98
+ };
99
+ const collectScopeIdentifiers = (node, scopes) => {
100
+ const {
101
+ type
102
+ } = node;
103
+ switch (type) {
104
+ case 'BlockStatement':
105
+ case 'ClassBody':
106
+ scopes.push({
107
+ node,
108
+ type: 'Block',
109
+ name: type,
110
+ idents: new Set()
111
+ });
112
+ break;
113
+ case 'FunctionDeclaration':
114
+ case 'FunctionExpression':
115
+ case 'ArrowFunctionExpression':
116
+ {
117
+ const name = node.id ? node.id.name : 'anonymous';
118
+ const scope = {
119
+ node,
120
+ name,
121
+ type: 'Function',
122
+ idents: new Set()
123
+ };
124
+ node.params.map(param => {
125
+ if (param.type === 'TSParameterProperty') {
126
+ return param.parameter;
127
+ }
128
+ if (param.type === 'RestElement') {
129
+ return param.argument;
130
+ }
131
+ if (param.type === 'AssignmentPattern') {
132
+ return param.left;
133
+ }
134
+ return param;
135
+ }).filter(identifier.isNamed).forEach(param => {
136
+ scope.idents.add(param.name);
137
+ });
138
+
139
+ /**
140
+ * If a FunctionExpression has an id, it is a named function expression.
141
+ * The function expression name shadows the module scope identifier, so
142
+ * we don't want to count reads of module identifers that have the same name.
143
+ * They also do not cause a SyntaxError if the function expression name is
144
+ * the same as a module scope identifier.
145
+ *
146
+ * TODO: Is this necessary for FunctionDeclaration?
147
+ */
148
+ if (node.type === 'FunctionExpression' && node.id) {
149
+ scope.idents.add(node.id.name);
150
+ }
151
+
152
+ // First add the function to any previous scopes
153
+ if (scopes.length > 0) {
154
+ scopes[scopes.length - 1].idents.add(name);
155
+ }
156
+
157
+ // Then add the function scope to the scopes stack
158
+ scopes.push(scope);
159
+ }
160
+ break;
161
+ case 'ClassDeclaration':
162
+ {
163
+ const className = node.id ? node.id.name : 'anonymous';
164
+
165
+ // First add the class to any previous scopes
166
+ if (scopes.length > 0) {
167
+ scopes[scopes.length - 1].idents.add(className);
168
+ }
169
+
170
+ // Then add the class to the scopes stack
171
+ scopes.push({
172
+ node,
173
+ name: className,
174
+ type: 'Class',
175
+ idents: new Set()
176
+ });
177
+ }
178
+ break;
179
+ case 'ClassExpression':
180
+ {}
181
+ break;
182
+ case 'VariableDeclaration':
183
+ if (scopes.length > 0) {
184
+ const scope = scopes[scopes.length - 1];
185
+ node.declarations.forEach(decl => {
186
+ if (decl.type === 'VariableDeclarator' && decl.id.type === 'Identifier') {
187
+ scope.idents.add(decl.id.name);
188
+ }
189
+ });
190
+ }
191
+ break;
192
+ }
193
+ };
194
+
195
+ /**
196
+ * Collects all module scope identifiers in the AST.
197
+ *
198
+ * Ignores identifiers that are in functions or classes.
199
+ * Ignores new scopes for StaticBlock nodes (can only reference static class members).
200
+ *
201
+ * Special case handling for these which create their own scopes,
202
+ * but are also valid module scope identifiers:
203
+ * - ClassDeclaration
204
+ * - FunctionDeclaration
205
+ *
206
+ * Special case handling for var inside BlockStatement
207
+ * which are also valid module scope identifiers.
208
+ */
209
+ const collectModuleIdentifiers = async (ast, hoisting = true) => {
210
+ const identifiers = new Map();
211
+ const globalReads = new Map();
212
+ const scopes = [];
213
+ await ancestorWalk(ast, {
214
+ enter(node, ancestors) {
215
+ const {
216
+ type
217
+ } = node;
218
+ collectScopeIdentifiers(node, scopes);
219
+
220
+ // Add module scope identifiers to the registry map
221
+
222
+ if (type === 'Identifier') {
223
+ const {
224
+ name
225
+ } = node;
226
+ const meta = identifiers.get(name) ?? {
227
+ declare: [],
228
+ read: []
229
+ };
230
+ const isDeclaration = identifier.isDeclaration(ancestors);
231
+ const inScope = scopes.some(scope => scope.idents.has(name) || scope.name === name);
232
+ if (hoisting && !identifier.isDeclaration(ancestors) && !identifier.isFunctionExpressionId(ancestors) && !identifier.isExportSpecifierAlias(ancestors) && !identifier.isClassPropertyKey(ancestors) && !identifier.isMethodDefinitionKey(ancestors) && !identifier.isMemberKey(ancestors) && !identifier.isPropertyKey(ancestors) && !identifier.isIife(ancestors) && !inScope) {
233
+ if (globalReads.has(name)) {
234
+ globalReads.get(name)?.push(node);
235
+ } else {
236
+ globalReads.set(name, [node]);
237
+ }
238
+ }
239
+ if (isDeclaration) {
240
+ const isModuleScope = identifier.isModuleScope(ancestors);
241
+ const isClassOrFuncDeclaration = identifier.isClassOrFuncDeclarationId(ancestors);
242
+ const isVarDeclarationInGlobalScope = identifier.isVarDeclarationInGlobalScope(ancestors);
243
+ if (isModuleScope || isClassOrFuncDeclaration || isVarDeclarationInGlobalScope) {
244
+ meta.declare.push(node);
245
+
246
+ // Check for hoisted reads
247
+ if (hoisting && globalReads.has(name)) {
248
+ const reads = globalReads.get(name);
249
+ if (reads) {
250
+ reads.forEach(read => {
251
+ if (!meta.read.includes(read)) {
252
+ meta.read.push(read);
253
+ }
254
+ });
255
+ }
256
+ }
257
+ identifiers.set(name, meta);
258
+ }
259
+ } else {
260
+ if (identifiers.has(name) && !inScope && !identifier.isIife(ancestors) && !identifier.isFunctionExpressionId(ancestors) && !identifier.isExportSpecifierAlias(ancestors) && !identifier.isClassPropertyKey(ancestors) && !identifier.isMethodDefinitionKey(ancestors) && !identifier.isMemberKey(ancestors) && !identifier.isPropertyKey(ancestors)) {
261
+ // Closure is referencing module scope identifier
262
+ meta.read.push(node);
263
+ }
264
+ }
265
+ }
266
+ },
267
+ leave(node) {
268
+ const {
269
+ type
270
+ } = node;
271
+ if (scopeNodes.includes(type)) {
272
+ scopes.pop();
273
+ }
274
+ }
275
+ });
276
+ return identifiers;
277
+ };
278
+ export { getLangFromExt, isValidUrl, collectScopeIdentifiers, collectModuleIdentifiers, collectCjsExports, exportsRename, requireMainRgx };
package/dist/walk.d.ts ADDED
@@ -0,0 +1,20 @@
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/walk.js ADDED
@@ -0,0 +1,69 @@
1
+ import { visitorKeys } from 'oxc-parser';
2
+
3
+ /**
4
+ * Using visitorKeys instead of oxc Visitor to keep
5
+ * an ancestor-aware enter/leave API with this.skip()
6
+ * without per-node method boilerplate.
7
+ */
8
+
9
+ let skipDepth = -1;
10
+ const isNodeLike = value => {
11
+ return Boolean(value && typeof value === 'object' && 'type' in value);
12
+ };
13
+ const traverse = async (node, visitors, ancestors, depth) => {
14
+ if (!node) return;
15
+ const keys = visitorKeys[node.type] ?? [];
16
+ const ctx = {
17
+ skip: () => {
18
+ skipDepth = depth;
19
+ }
20
+ };
21
+ ancestors.push(node);
22
+ if (visitors.enter) {
23
+ await visitors.enter.call(ctx, node, ancestors);
24
+ }
25
+ if (skipDepth === -1 || depth < skipDepth) {
26
+ const fields = node;
27
+ for (const key of keys) {
28
+ const child = fields[key];
29
+ if (Array.isArray(child)) {
30
+ for (const nested of child) {
31
+ if (isNodeLike(nested)) {
32
+ await traverse(nested, visitors, ancestors, depth + 1);
33
+ }
34
+ }
35
+ } else if (isNodeLike(child)) {
36
+ await traverse(child, visitors, ancestors, depth + 1);
37
+ }
38
+ }
39
+ }
40
+ if (visitors.leave) {
41
+ await visitors.leave.call(ctx, node, ancestors);
42
+ }
43
+ ancestors.pop();
44
+ if (skipDepth === depth) {
45
+ skipDepth = -1;
46
+ }
47
+ };
48
+ const ancestorWalk = async (node, visitors) => {
49
+ skipDepth = -1;
50
+ await traverse(node, visitors, [], 0);
51
+ };
52
+ const walk = async (node, visitors) => {
53
+ const wrap = {
54
+ enter(current, ancestors) {
55
+ const parent = ancestors[ancestors.length - 2] ?? null;
56
+ if (visitors.enter) {
57
+ return visitors.enter.call(this, current, parent);
58
+ }
59
+ },
60
+ leave(current, ancestors) {
61
+ const parent = ancestors[ancestors.length - 2] ?? null;
62
+ if (visitors.leave) {
63
+ return visitors.leave.call(this, current, parent);
64
+ }
65
+ }
66
+ };
67
+ await ancestorWalk(node, wrap);
68
+ };
69
+ export { ancestorWalk, walk };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@knighted/module",
3
- "version": "1.0.0-alpha.9",
4
- "description": "Transforms module differences between ES and CommonJS.",
3
+ "version": "1.0.0-beta.1",
4
+ "description": "Transforms differences between ES modules and CommonJS.",
5
5
  "type": "module",
6
6
  "main": "dist/module.js",
7
7
  "exports": {
@@ -18,13 +18,24 @@
18
18
  },
19
19
  "./package.json": "./package.json"
20
20
  },
21
+ "imports": {
22
+ "#parse": "./src/parse.js",
23
+ "#format": "./src/format.js",
24
+ "#utils/*.js": "./src/utils/*.js",
25
+ "#walk": "./src/walk.js",
26
+ "#helpers/*.js": "./src/helpers/*.js",
27
+ "#formatters/*.js": "./src/formatters/*.js"
28
+ },
21
29
  "engines": {
22
30
  "node": ">=20.11.0"
23
31
  },
24
32
  "engineStrict": true,
25
33
  "scripts": {
34
+ "check-types": "tsc -p tsconfig.test.json",
26
35
  "prettier": "prettier -w .",
27
- "lint": "eslint --ignore-pattern dist .",
36
+ "prettier:check": "prettier -c .",
37
+ "lint": "oxlint --config oxlint.json .",
38
+ "prepare": "husky install",
28
39
  "test": "c8 --reporter=text --reporter=text-summary --reporter=lcov tsx --test --test-reporter=spec test/*.ts",
29
40
  "build:types": "tsc --emitDeclarationOnly",
30
41
  "build:dual": "babel-dual-package src --extensions .ts",
@@ -33,8 +44,14 @@
33
44
  },
34
45
  "keywords": [
35
46
  "transform",
36
- "esm",
37
- "commonjs"
47
+ "es module",
48
+ "commonjs",
49
+ "require",
50
+ "require.resolve",
51
+ "import.meta.url",
52
+ "import.meta.dirname",
53
+ "__dirname",
54
+ "__filename"
38
55
  ],
39
56
  "files": [
40
57
  "dist"
@@ -49,34 +66,35 @@
49
66
  "url": "https://github.com/knightedcodemonkey/module/issues"
50
67
  },
51
68
  "devDependencies": {
52
- "@babel/preset-env": "^7.28.0",
53
- "@babel/preset-typescript": "^7.27.1",
54
- "@babel/types": "^7.28.2",
55
- "@eslint/js": "^9.3.0",
56
- "@types/babel__traverse": "^7.20.7",
69
+ "@knighted/dump": "^1.0.3",
57
70
  "@types/node": "^22.13.17",
58
- "babel-dual-package": "^1.2.1",
71
+ "babel-dual-package": "^1.2.3",
59
72
  "c8": "^10.1.3",
60
- "eslint": "^9.32.0",
61
- "eslint-plugin-n": "^17.21.2",
62
- "prettier": "^3.2.5",
63
- "tsx": "^4.20.3",
64
- "typescript": "^5.8.3",
65
- "typescript-eslint": "^8.38.0"
73
+ "husky": "^9.1.7",
74
+ "lint-staged": "^16.2.7",
75
+ "oxlint": "^1.35.0",
76
+ "prettier": "^3.7.4",
77
+ "tsx": "^4.21.0",
78
+ "typescript": "^5.9.3"
66
79
  },
67
80
  "dependencies": {
68
- "@babel/parser": "^7.28.0",
69
- "@babel/traverse": "^7.28.0",
70
- "@knighted/specifier": "^2.0.7",
71
- "@knighted/walk": "^1.0.0",
72
- "magic-string": "^0.30.10",
73
- "node-module-type": "^1.0.2",
74
- "oxc-parser": "^0.78.0"
81
+ "@knighted/specifier": "^2.0.9",
82
+ "magic-string": "^0.30.21",
83
+ "node-module-type": "^1.0.4",
84
+ "oxc-parser": "^0.105.0",
85
+ "periscopic": "^4.0.2"
75
86
  },
76
87
  "prettier": {
77
88
  "arrowParens": "avoid",
78
- "printWidth": 119,
89
+ "printWidth": 90,
79
90
  "semi": false,
80
91
  "singleQuote": true
92
+ },
93
+ "lint-staged": {
94
+ "*.{js,ts,tsx,jsx,cjs,mjs}": [
95
+ "prettier -c",
96
+ "oxlint --config oxlint.json"
97
+ ],
98
+ "*.{json,md,yml,yaml,css,scss,html}": "prettier -c"
81
99
  }
82
100
  }
@@ -1,5 +0,0 @@
1
- import MagicString from 'magic-string';
2
- import type { NodePath } from '@babel/traverse';
3
- import type { ExpressionStatement } from '@babel/types';
4
- import type { FormatterOptions } from '../types.js';
5
- export declare const expressionStatement: (nodePath: NodePath<ExpressionStatement>, src: MagicString, options: FormatterOptions) => void;
@@ -1,5 +0,0 @@
1
- import MagicString from 'magic-string';
2
- import type { NodePath } from '@babel/traverse';
3
- import type { Identifier } from '@babel/types';
4
- import type { FormatterOptions } from '../types.js';
5
- export declare const identifier: (nodePath: NodePath<Identifier>, src: MagicString, options: FormatterOptions) => void;
@@ -1,5 +0,0 @@
1
- import MagicString from 'magic-string';
2
- import type { NodePath } from '@babel/traverse';
3
- import type { MemberExpression } from '@babel/types';
4
- import type { FormatterOptions } from '../types.js';
5
- export declare const memberExpression: (nodePath: NodePath<MemberExpression>, src: MagicString, options: FormatterOptions) => void;
@@ -1,5 +0,0 @@
1
- import MagicString from 'magic-string';
2
- import type { NodePath } from '@babel/traverse';
3
- import type { MetaProperty } from '@babel/types';
4
- import type { FormatterOptions } from '../types.js';
5
- export declare const metaProperty: (nodePath: NodePath<MetaProperty>, src: MagicString, options: FormatterOptions) => void;