Comparing version 0.2.3 to 0.2.4
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.2.4](https://github.com/unjs/mlly/compare/v0.2.3...v0.2.4) (2021-10-01) | ||
### Features | ||
* add types for import analyzes ([b9ca4af](https://github.com/unjs/mlly/commit/b9ca4aff597453877674f0c9ebf504f19f989ea1)) | ||
### [0.2.3](https://github.com/unjs/mlly/compare/v0.2.2...v0.2.3) (2021-10-01) | ||
@@ -7,0 +14,0 @@ |
@@ -26,2 +26,32 @@ // CommonJS | ||
// Import analyzes | ||
export interface ESMImport { | ||
type: 'static' | 'dynamic' | ||
code: string | ||
start: number | ||
end: number | ||
} | ||
export interface StaticImport extends ESMImport { | ||
type: 'static' | ||
imports: string | ||
specifier: string | ||
} | ||
export interface ParsedStaticImport extends StaticImport { | ||
defaultImport?: string | ||
namespacedImport?: string | ||
namedImports?: { [name: string]: string } | ||
} | ||
export interface DynamicImport extends ESMImport { | ||
type: 'dynamic' | ||
expression: string | ||
} | ||
export function findStaticImports (code: string) : StaticImport[] | ||
export function findDynamicImports (code: string) : DynamicImport[] | ||
export function parseStaticImport (staticImport: StaticImport) : ParsedStaticImport | ||
// Evaluate | ||
@@ -28,0 +58,0 @@ |
{ | ||
"name": "mlly", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "Missing ECMAScript module utils for Node.js", | ||
@@ -5,0 +5,0 @@ "repository": "unjs/mlly", |
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
21405
275