@davidwells/extract-deps 0.1.4 → 0.1.7

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 (71) hide show
  1. package/package.json +1 -1
  2. package/src/dep-graph.js +26 -0
  3. package/src/get-imports.js +23 -9
  4. package/src/get-requires.js +6 -4
  5. package/tests/dep-graph.test.js +90 -0
  6. package/tests/fixtures/esm-namespace-fixture/index.js +5 -0
  7. package/tests/fixtures/esm-namespace-fixture/package.json +4 -0
  8. package/tests/fixtures/esm-namespace-fixture/utils.js +7 -0
  9. package/tests/fixtures/esm-reexport-fixture/barrel.js +1 -0
  10. package/tests/fixtures/esm-reexport-fixture/impl.js +7 -0
  11. package/tests/fixtures/esm-reexport-fixture/index.js +5 -0
  12. package/tests/fixtures/esm-reexport-fixture/package.json +4 -0
  13. package/tests/fixtures/node-module-named-export/node_modules/fake-named-pkg/index.js +1 -2
  14. package/tests/fixtures/ts-patterns-fixture/constants.ts +2 -0
  15. package/tests/fixtures/ts-patterns-fixture/index.ts +17 -0
  16. package/tests/fixtures/ts-patterns-fixture/package.json +4 -0
  17. package/tests/fixtures/ts-patterns-fixture/transforms.ts +7 -0
  18. package/tests/fixtures/ts-patterns-fixture/utils.ts +7 -0
  19. package/tests/get-imports.test.js +101 -4
  20. package/tests/get-requires.test.js +60 -0
  21. package/.claude/settings.local.json +0 -17
  22. package/types/dep-graph.d.ts +0 -45
  23. package/types/dep-graph.d.ts.map +0 -1
  24. package/types/detect-syntax.d.ts +0 -39
  25. package/types/detect-syntax.d.ts.map +0 -1
  26. package/types/extract-deps/_usage.d.ts +0 -20
  27. package/types/extract-deps/_usage.d.ts.map +0 -1
  28. package/types/extract-deps/examples/get-exports.d.ts +0 -2
  29. package/types/extract-deps/examples/get-exports.d.ts.map +0 -1
  30. package/types/extract-deps/src/detect-syntax.d.ts +0 -39
  31. package/types/extract-deps/src/detect-syntax.d.ts.map +0 -1
  32. package/types/extract-deps/src/get-exports.d.ts +0 -52
  33. package/types/extract-deps/src/get-exports.d.ts.map +0 -1
  34. package/types/extract-deps/src/get-imports.d.ts +0 -53
  35. package/types/extract-deps/src/get-imports.d.ts.map +0 -1
  36. package/types/extract-deps/src/get-requires.d.ts +0 -34
  37. package/types/extract-deps/src/get-requires.d.ts.map +0 -1
  38. package/types/extract-deps/src/index.d.ts +0 -39
  39. package/types/extract-deps/src/index.d.ts.map +0 -1
  40. package/types/extract-deps/src/utils.d.ts +0 -4
  41. package/types/extract-deps/src/utils.d.ts.map +0 -1
  42. package/types/extract-deps/tests/detect-syntax.test.d.ts +0 -2
  43. package/types/extract-deps/tests/detect-syntax.test.d.ts.map +0 -1
  44. package/types/extract-deps/tests/get-exports.test.d.ts +0 -2
  45. package/types/extract-deps/tests/get-exports.test.d.ts.map +0 -1
  46. package/types/extract-deps/tests/get-imports.test.d.ts +0 -2
  47. package/types/extract-deps/tests/get-imports.test.d.ts.map +0 -1
  48. package/types/extract-deps/tests/get-requires.test.d.ts +0 -2
  49. package/types/extract-deps/tests/get-requires.test.d.ts.map +0 -1
  50. package/types/extract-deps/tests/index.test.d.ts +0 -18
  51. package/types/extract-deps/tests/index.test.d.ts.map +0 -1
  52. package/types/extract-deps/tests/test-utils.d.ts +0 -9
  53. package/types/extract-deps/tests/test-utils.d.ts.map +0 -1
  54. package/types/get-cjs-exports.d.ts +0 -45
  55. package/types/get-cjs-exports.d.ts.map +0 -1
  56. package/types/get-exports.d.ts +0 -54
  57. package/types/get-exports.d.ts.map +0 -1
  58. package/types/get-imports.d.ts +0 -59
  59. package/types/get-imports.d.ts.map +0 -1
  60. package/types/get-requires.d.ts +0 -37
  61. package/types/get-requires.d.ts.map +0 -1
  62. package/types/index.d.ts +0 -45
  63. package/types/index.d.ts.map +0 -1
  64. package/types/packages-list/index.d.ts +0 -138
  65. package/types/packages-list/index.d.ts.map +0 -1
  66. package/types/utils.d.ts +0 -17
  67. package/types/utils.d.ts.map +0 -1
  68. package/types/vendor/inspect-parameters-declaration.d.ts +0 -4
  69. package/types/vendor/inspect-parameters-declaration.d.ts.map +0 -1
  70. package/types/verify-package-entries.d.ts +0 -30
  71. package/types/verify-package-entries.d.ts.map +0 -1
@@ -1,39 +0,0 @@
1
- /**
2
- * Options for detecting syntax within a code string.
3
- */
4
- export type DetectSyntaxOptions = {
5
- /**
6
- * - Indicates whether comments should be stripped from the code before syntax checking.
7
- */
8
- stripComments?: boolean;
9
- };
10
- /**
11
- * Options for detecting syntax within a code string.
12
- * @typedef {Object} DetectSyntaxOptions
13
- * @property {boolean} [stripComments=false] - Indicates whether comments should be stripped from the code before syntax checking.
14
- */
15
- /**
16
- * Determines if a given code string contains ECMAScript module syntax.
17
- *
18
- * @param {string} code - The source code to analyze.
19
- * @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
20
- * @returns {boolean} `true` if the code contains ESM syntax, otherwise `false`.
21
- */
22
- export function hasESMSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
23
- /**
24
- * Determines if a given string of code contains CommonJS syntax.
25
- *
26
- * @param {string} code - The source code to analyze.
27
- * @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
28
- * @returns {boolean} `true` if the code contains CommonJS syntax, `false` otherwise.
29
- */
30
- export function hasCJSSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
31
- /**
32
- * Analyzes the supplied code to determine if it contains ECMAScript module syntax, CommonJS syntax, or both.
33
- *
34
- * @param {string} code - The source code to analyze.
35
- * @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
36
- * @returns {Object} An object indicating the presence of ESM syntax (`hasESM`), CJS syntax (`hasCJS`) and whether both syntaxes are present (`isMixed`).
37
- */
38
- export function detectSyntax(code: string, opts?: DetectSyntaxOptions): any;
39
- //# sourceMappingURL=detect-syntax.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detect-syntax.d.ts","sourceRoot":"","sources":["../src/detect-syntax.js"],"names":[],"mappings":";;;;;;;oBAcc,OAAO;;AAHrB;;;;GAIG;AAEH;;;;;;GAMG;AACH,mCAJW,MAAM,SACN,mBAAmB,GACjB,OAAO,CAMnB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,SACN,mBAAmB,GACjB,OAAO,CAMnB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,SACN,mBAAmB,OAe7B"}
@@ -1,20 +0,0 @@
1
- /**
2
- * Analyze dependencies in the lerna fixture
3
- */
4
- export function analyzeLernaFixture(): void;
5
- /**
6
- * Example of using extractDeps with actual code files
7
- */
8
- export function analyzeCodeDependencies(): void;
9
- /**
10
- * Read and parse a package.json file
11
- * @param {string} filePath - Path to the package.json file
12
- * @returns {Object} Parsed package.json content
13
- */
14
- export function readPackageJson(filePath: string): any;
15
- /**
16
- * Get all package.json files in the lerna fixture
17
- * @returns {Array} Array of package.json file paths
18
- */
19
- export function getPackageJsonFiles(): any[];
20
- //# sourceMappingURL=_usage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_usage.d.ts","sourceRoot":"","sources":["../../_usage.js"],"names":[],"mappings":"AAuDA;;GAEG;AACH,4CA8BC;AAED;;GAEG;AACH,gDA4CC;AA7HD;;;;GAIG;AACH,0CAHW,MAAM,OAWhB;AAED;;;GAGG;AACH,6CAsBC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=get-exports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-exports.d.ts","sourceRoot":"","sources":["../../../examples/get-exports.js"],"names":[],"mappings":""}
@@ -1,39 +0,0 @@
1
- /**
2
- * Options for detecting syntax within a code string.
3
- */
4
- export type DetectSyntaxOptions = {
5
- /**
6
- * - Indicates whether comments should be stripped from the code before syntax checking.
7
- */
8
- stripComments?: boolean;
9
- };
10
- /**
11
- * Options for detecting syntax within a code string.
12
- * @typedef {Object} DetectSyntaxOptions
13
- * @property {boolean} [stripComments=false] - Indicates whether comments should be stripped from the code before syntax checking.
14
- */
15
- /**
16
- * Determines if a given code string contains ECMAScript module syntax.
17
- *
18
- * @param {string} code - The source code to analyze.
19
- * @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
20
- * @returns {boolean} `true` if the code contains ESM syntax, otherwise `false`.
21
- */
22
- export function hasESMSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
23
- /**
24
- * Determines if a given string of code contains CommonJS syntax.
25
- *
26
- * @param {string} code - The source code to analyze.
27
- * @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
28
- * @returns {boolean} `true` if the code contains CommonJS syntax, `false` otherwise.
29
- */
30
- export function hasCJSSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
31
- /**
32
- * Analyzes the supplied code to determine if it contains ECMAScript module syntax, CommonJS syntax, or both.
33
- *
34
- * @param {string} code - The source code to analyze.
35
- * @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
36
- * @returns {Object} An object indicating the presence of ESM syntax (`hasESM`), CJS syntax (`hasCJS`) and whether both syntaxes are present (`isMixed`).
37
- */
38
- export function detectSyntax(code: string, opts?: DetectSyntaxOptions): any;
39
- //# sourceMappingURL=detect-syntax.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detect-syntax.d.ts","sourceRoot":"","sources":["../../../src/detect-syntax.js"],"names":[],"mappings":";;;;;;;oBAec,OAAO;;AAHrB;;;;GAIG;AAEH;;;;;;GAMG;AACH,mCAJW,MAAM,SACN,mBAAmB,GACjB,OAAO,CAMnB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,SACN,mBAAmB,GACjB,OAAO,CAMnB;AAED;;;;;;GAMG;AACH,mCAJW,MAAM,SACN,mBAAmB,OAe7B"}
@@ -1,52 +0,0 @@
1
- export function getExports(code: any, options?: {}): any[];
2
- export function getDefaultExports(targetText?: string): {
3
- line: string;
4
- exportType: string;
5
- exportName: any;
6
- exportValue: string;
7
- index: number;
8
- isExport: boolean;
9
- }[];
10
- export function getNamedExports(targetText?: string): {
11
- line: string;
12
- exportType: string;
13
- exportName: string;
14
- index: number;
15
- isExport: boolean;
16
- }[];
17
- export function getNamedDeclarationExports(targetText?: string): any[];
18
- export function getAllExports(targetText?: string): {
19
- line: string;
20
- exportType: string;
21
- from: string;
22
- index: number;
23
- isExport: boolean;
24
- }[];
25
- export function getNamespaceExports(targetText?: string): {
26
- line: string;
27
- exportType: string;
28
- namespace: string;
29
- from: string;
30
- index: number;
31
- isExport: boolean;
32
- }[];
33
- export function getTypeExports(targetText?: string): {
34
- line: string;
35
- exportType: string;
36
- exportName: string;
37
- index: number;
38
- isExport: boolean;
39
- }[];
40
- export function getAssertionExports(targetText?: string): {
41
- line: string;
42
- exportType: string;
43
- exportName: string;
44
- definitions: any;
45
- from: string;
46
- assertion: string;
47
- assertionType: string;
48
- index: number;
49
- isExport: boolean;
50
- isAssertion: boolean;
51
- }[];
52
- //# sourceMappingURL=get-exports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-exports.d.ts","sourceRoot":"","sources":["../../../src/get-exports.js"],"names":[],"mappings":"AAiBA,2DAsBC;AAED;;;;;;;IA4BC;AAED;;;;;;IAeC;AAED,uEAmBC;AAED;;;;;;IAeC;AAED;;;;;;;IAgBC;AAED;;;;;;IAeC;AAED;;;;;;;;;;;IAuBC"}
@@ -1,53 +0,0 @@
1
- export function getImports(code: any, options?: {}): {
2
- line: string;
3
- varType: string;
4
- varName: string;
5
- definitions: any;
6
- from: string;
7
- index: number;
8
- isImport: boolean;
9
- isRelative: boolean;
10
- }[];
11
- export function getStaticImports(targetText?: string): {
12
- line: string;
13
- varType: string;
14
- varName: string;
15
- definitions: any;
16
- from: string;
17
- index: number;
18
- isImport: boolean;
19
- isRelative: boolean;
20
- }[];
21
- export function getTypeImports(targetText?: string): {
22
- importStatement: string;
23
- importPath: string;
24
- importName: string;
25
- index: number;
26
- isImport: boolean;
27
- isRelative: boolean;
28
- }[];
29
- export function getDynamicImports(targetText?: string): {
30
- line: string;
31
- varType: string;
32
- varName: string;
33
- definitions: any;
34
- from: string;
35
- index: number;
36
- isImport: boolean;
37
- isRelative: boolean;
38
- isDynamic: boolean;
39
- }[];
40
- export function getAssertionImports(targetText?: string): {
41
- line: string;
42
- varType: string;
43
- varName: string;
44
- definitions: any;
45
- from: string;
46
- assertion: string;
47
- assertionType: string;
48
- index: number;
49
- isImport: boolean;
50
- isRelative: boolean;
51
- isAssertion: boolean;
52
- }[];
53
- //# sourceMappingURL=get-imports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-imports.d.ts","sourceRoot":"","sources":["../../../src/get-imports.js"],"names":[],"mappings":"AAWA;;;;;;;;;IAQC;AAGD;;;;;;;;;IAkBC;AAED;;;;;;;IAgBC;AAED;;;;;;;;;;IAoBC;AAED;;;;;;;;;;;;IAwBC"}
@@ -1,34 +0,0 @@
1
- export function getRequires(code: any): {
2
- line: string;
3
- varType: string;
4
- varName: string;
5
- definitions: any;
6
- from: string;
7
- index: number;
8
- isRequire: boolean;
9
- isRelative: boolean;
10
- isDynamic: boolean;
11
- }[];
12
- export function getStaticRequires(targetText?: string): {
13
- line: string;
14
- varType: string;
15
- varName: string;
16
- definitions: any;
17
- from: string;
18
- index: number;
19
- isRequire: boolean;
20
- isRelative: boolean;
21
- isDynamic: boolean;
22
- }[];
23
- export function getDynamicRequires(code: any): {
24
- line: string;
25
- varType: string;
26
- varName: string;
27
- definitions: any;
28
- from: string;
29
- index: number;
30
- isRequire: boolean;
31
- isRelative: boolean;
32
- isDynamic: boolean;
33
- }[];
34
- //# sourceMappingURL=get-requires.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-requires.d.ts","sourceRoot":"","sources":["../../../src/get-requires.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;IAIC;AA5BD;;;;;;;;;;IAsBC;AArDD;;;;;;;;;;IA4BC"}
@@ -1,39 +0,0 @@
1
- export function extractDeps(code: any): {
2
- imports: {
3
- line: string;
4
- varType: string;
5
- varName: string;
6
- definitions: any;
7
- from: string;
8
- index: number;
9
- isImport: boolean;
10
- isRelative: boolean;
11
- }[];
12
- requires: {
13
- line: string;
14
- varType: string;
15
- varName: string;
16
- definitions: any;
17
- from: string;
18
- index: number;
19
- isRequire: boolean;
20
- isRelative: boolean;
21
- isDynamic: boolean;
22
- }[];
23
- exports: any[];
24
- };
25
- import { getRequires } from "./get-requires";
26
- import { getDynamicRequires } from "./get-requires";
27
- import { getStaticRequires } from "./get-requires";
28
- import { getImports } from "./get-imports";
29
- import { getStaticImports } from "./get-imports";
30
- import { getDynamicImports } from "./get-imports";
31
- import { getExports } from "./get-exports";
32
- import { getDefaultExports } from "./get-exports";
33
- import { getNamedExports } from "./get-exports";
34
- import { getNamedDeclarationExports } from "./get-exports";
35
- import { getAllExports } from "./get-exports";
36
- import { getNamespaceExports } from "./get-exports";
37
- import { getTypeExports } from "./get-exports";
38
- export { getRequires, getDynamicRequires, getStaticRequires, getImports, getStaticImports, getDynamicImports, getExports, getDefaultExports, getNamedExports, getNamedDeclarationExports, getAllExports, getNamespaceExports, getTypeExports };
39
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;EAQC"}
@@ -1,4 +0,0 @@
1
- export function isRelativeImport(importLocation: any): boolean;
2
- export function isRelativeImportWithQuotes(importLocation: any): boolean;
3
- export function getNames(names?: any[]): any;
4
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.js"],"names":[],"mappings":"AAEA,+DAEC;AAED,yEAKC;AAED,6CA2CC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=detect-syntax.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detect-syntax.test.d.ts","sourceRoot":"","sources":["../../../tests/detect-syntax.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=get-exports.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-exports.test.d.ts","sourceRoot":"","sources":["../../../tests/get-exports.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=get-imports.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-imports.test.d.ts","sourceRoot":"","sources":["../../../tests/get-imports.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=get-requires.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-requires.test.d.ts","sourceRoot":"","sources":["../../../tests/get-requires.test.js"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- export type PackageDeps = {
2
- /**
3
- * - Package name
4
- */
5
- name: string;
6
- /**
7
- * - Path to main file
8
- */
9
- mainFile: string;
10
- /**
11
- * - Extracted dependencies
12
- */
13
- deps: {
14
- imports: any[];
15
- requires: any[];
16
- };
17
- };
18
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../tests/index.test.js"],"names":[],"mappings":";;;;UAWc,MAAM;;;;cACN,MAAM;;;;;QAEM,OAAO;QACP,QAAQ"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Normalizes test results by removing the `index` field from import/require objects
3
- * This is useful for testing since index values can vary and aren't part of the core functionality
4
- * @param {Array|Object} result - The result object or array of result objects to normalize
5
- * @returns {Array|Object} - The normalized result with index fields removed
6
- */
7
- export function normalizeTestResult(result: any[] | any): any[] | any;
8
- export function deepLog(myObject: any): void;
9
- //# sourceMappingURL=test-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../tests/test-utils.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,4CAHW,WAAY,GACV,WAAY,CAcxB;AAED,6CAEC"}
@@ -1,45 +0,0 @@
1
- export function getCjsExports(code: any): any[];
2
- export function getModuleExportsAssignment(originalText?: string, sanitizedText?: string): {
3
- line: string;
4
- exportType: string;
5
- exportName: string;
6
- exportDefinitionName: any;
7
- exportValue: string;
8
- index: number;
9
- isExport: boolean;
10
- }[];
11
- export function getModuleExportsProperty(originalText?: string, sanitizedText?: string): {
12
- line: string;
13
- exportType: string;
14
- exportName: string;
15
- exportValue: string;
16
- index: number;
17
- isExport: boolean;
18
- }[];
19
- export function getExportsProperty(originalText?: string, sanitizedText?: string): {
20
- line: string;
21
- exportType: string;
22
- exportName: string;
23
- exportValue: string;
24
- index: number;
25
- isExport: boolean;
26
- }[];
27
- export function getObjectAssignExports(originalText?: string, sanitizedText?: string): {
28
- line: string;
29
- exportType: string;
30
- exportName: string;
31
- exportValue: string;
32
- index: number;
33
- isExport: boolean;
34
- }[];
35
- export function getDefinePropertyExports(originalText?: string, sanitizedText?: string): {
36
- line: string;
37
- exportType: string;
38
- exportName: string;
39
- exportValue: string;
40
- exportDefinitionName: string;
41
- index: number;
42
- isExport: boolean;
43
- isDefineProperty: boolean;
44
- }[];
45
- //# sourceMappingURL=get-cjs-exports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-cjs-exports.d.ts","sourceRoot":"","sources":["../src/get-cjs-exports.js"],"names":[],"mappings":"AAoCA,gDAiCC;AA+BD;;;;;;;;IAqGC;AAED;;;;;;;IAqBC;AAED;;;;;;;IAqBC;AAED;;;;;;;IAiDC;AAED;;;;;;;;;IAwEC"}
@@ -1,54 +0,0 @@
1
- export function getExports(code?: string, options?: {}): any[];
2
- export function getDefaultExports(targetText?: string): {
3
- line: string;
4
- exportType: string;
5
- exportName: string;
6
- exportDefinitionName: any;
7
- exportValue: string;
8
- index: number;
9
- isExport: boolean;
10
- }[];
11
- export function getNamedExports(targetText?: string): {
12
- line: string;
13
- exportType: string;
14
- exportName: string;
15
- index: number;
16
- isExport: boolean;
17
- }[];
18
- export function getNamedDeclarationExports(targetText?: string): any[];
19
- export function getAllExports(targetText?: string): {
20
- line: string;
21
- exportType: string;
22
- from: string;
23
- index: number;
24
- isExport: boolean;
25
- }[];
26
- export function getNamespaceExports(targetText?: string): {
27
- line: string;
28
- exportType: string;
29
- namespace: string;
30
- from: string;
31
- index: number;
32
- isExport: boolean;
33
- }[];
34
- export function getTypeExports(targetText?: string): {
35
- line: string;
36
- exportType: string;
37
- exportName: string;
38
- index: number;
39
- isExport: boolean;
40
- }[];
41
- export function getAssertionExports(targetText?: string): {
42
- line: string;
43
- exportType: string;
44
- exportName: string;
45
- definitions: any;
46
- keys: any;
47
- from: string;
48
- assertion: string;
49
- assertionType: string;
50
- index: number;
51
- isExport: boolean;
52
- isAssertion: boolean;
53
- }[];
54
- //# sourceMappingURL=get-exports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-exports.d.ts","sourceRoot":"","sources":["../src/get-exports.js"],"names":[],"mappings":"AAiBA,+DAiCC;AAED;;;;;;;;IAqDC;AAED;;;;;;IAeC;AAED,uEAuBC;AAED;;;;;;IAeC;AAED;;;;;;;IAgBC;AAED;;;;;;IAeC;AAED;;;;;;;;;;;;IA0BC"}
@@ -1,59 +0,0 @@
1
- export function getImports(code?: string, options?: {}): {
2
- line: string;
3
- varType: string;
4
- varName: string;
5
- definitions: any;
6
- from: string;
7
- index: number;
8
- isImport: boolean;
9
- isRelative: boolean;
10
- isBuiltIn: boolean;
11
- }[];
12
- export function getStaticImports(targetText?: string): {
13
- line: string;
14
- varType: string;
15
- varName: string;
16
- definitions: any;
17
- from: string;
18
- index: number;
19
- isImport: boolean;
20
- isRelative: boolean;
21
- isBuiltIn: boolean;
22
- }[];
23
- export function getTypeImports(targetText?: string): {
24
- importStatement: string;
25
- importPath: string;
26
- importName: string;
27
- index: number;
28
- isImport: boolean;
29
- isTypeImport: boolean;
30
- isRelative: boolean;
31
- isBuiltIn: boolean;
32
- }[];
33
- export function getDynamicImports(targetText?: string): {
34
- line: string;
35
- varType: string;
36
- varName: string;
37
- definitions: any;
38
- from: string;
39
- index: number;
40
- isImport: boolean;
41
- isRelative: boolean;
42
- isBuiltIn: boolean;
43
- isDynamic: boolean;
44
- }[];
45
- export function getAssertionImports(targetText?: string): {
46
- line: string;
47
- varType: string;
48
- varName: string;
49
- definitions: any;
50
- from: string;
51
- assertion: string;
52
- assertionType: string;
53
- index: number;
54
- isImport: boolean;
55
- isRelative: boolean;
56
- isBuiltIn: boolean;
57
- isAssertion: boolean;
58
- }[];
59
- //# sourceMappingURL=get-imports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-imports.d.ts","sourceRoot":"","sources":["../src/get-imports.js"],"names":[],"mappings":"AAWA;;;;;;;;;;IAUC;AAGD;;;;;;;;;;IAmBC;AAED;;;;;;;;;IAkBC;AAED;;;;;;;;;;;IAqBC;AAED;;;;;;;;;;;;;IAyBC"}
@@ -1,37 +0,0 @@
1
- export function getRequires(code: any): {
2
- line: string;
3
- varType: string;
4
- varName: string;
5
- definitions: any;
6
- from: string;
7
- index: number;
8
- isRequire: boolean;
9
- isRelative: boolean;
10
- isBuiltIn: boolean;
11
- isDynamic: boolean;
12
- }[];
13
- export function getStaticRequires(targetText?: string): {
14
- line: string;
15
- varType: string;
16
- varName: string;
17
- definitions: any;
18
- from: string;
19
- index: number;
20
- isRequire: boolean;
21
- isRelative: boolean;
22
- isBuiltIn: boolean;
23
- isDynamic: boolean;
24
- }[];
25
- export function getDynamicRequires(code: any): {
26
- line: string;
27
- varType: string;
28
- varName: string;
29
- definitions: any;
30
- from: string;
31
- index: number;
32
- isRequire: boolean;
33
- isRelative: boolean;
34
- isBuiltIn: boolean;
35
- isDynamic: boolean;
36
- }[];
37
- //# sourceMappingURL=get-requires.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-requires.d.ts","sourceRoot":"","sources":["../src/get-requires.js"],"names":[],"mappings":"AAgEA;;;;;;;;;;;IAIC;AA7BD;;;;;;;;;;;IAuBC;AAvDD;;;;;;;;;;;IA6BC"}
package/types/index.d.ts DELETED
@@ -1,45 +0,0 @@
1
- export function extractDeps(code: any, filePath?: string): {
2
- imports: {
3
- line: string;
4
- varType: string;
5
- varName: string;
6
- definitions: any;
7
- from: string;
8
- index: number;
9
- isImport: boolean;
10
- isRelative: boolean;
11
- isBuiltIn: boolean;
12
- }[];
13
- exports: any[];
14
- requires: {
15
- line: string;
16
- varType: string;
17
- varName: string;
18
- definitions: any;
19
- from: string;
20
- index: number;
21
- isRequire: boolean;
22
- isRelative: boolean;
23
- isBuiltIn: boolean;
24
- isDynamic: boolean;
25
- }[];
26
- moduleExports: any[];
27
- };
28
- import { hasESMSyntax } from "./detect-syntax";
29
- import { hasCJSSyntax } from "./detect-syntax";
30
- import { detectSyntax } from "./detect-syntax";
31
- import { getRequires } from "./get-requires";
32
- import { getDynamicRequires } from "./get-requires";
33
- import { getStaticRequires } from "./get-requires";
34
- import { getImports } from "./get-imports";
35
- import { getStaticImports } from "./get-imports";
36
- import { getDynamicImports } from "./get-imports";
37
- import { getExports } from "./get-exports";
38
- import { getDefaultExports } from "./get-exports";
39
- import { getNamedExports } from "./get-exports";
40
- import { getNamedDeclarationExports } from "./get-exports";
41
- import { getAllExports } from "./get-exports";
42
- import { getNamespaceExports } from "./get-exports";
43
- import { getTypeExports } from "./get-exports";
44
- export { hasESMSyntax, hasCJSSyntax, detectSyntax, getRequires, getDynamicRequires, getStaticRequires, getImports, getStaticImports, getDynamicImports, getExports, getDefaultExports, getNamedExports, getNamedDeclarationExports, getAllExports, getNamespaceExports, getTypeExports };
45
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBC"}