Comparing version 1.4.2 to 1.5.0
@@ -57,2 +57,3 @@ interface ResolveOptions { | ||
name?: string; | ||
defaultName?: string; | ||
names: string[]; | ||
@@ -95,3 +96,5 @@ specifier?: string; | ||
declare function createCommonJS(url: string): CommonjsContext; | ||
declare function interopDefault(sourceModule: any): any; | ||
declare function interopDefault(sourceModule: any, opts?: { | ||
preferNamespace?: boolean; | ||
}): any; | ||
@@ -106,5 +109,8 @@ interface EvaluateOptions extends ResolveOptions { | ||
declare function hasESMSyntax(code: string): boolean; | ||
declare function hasCJSSyntax(code: string): boolean; | ||
declare function detectSyntax(code: string): { | ||
type DetectSyntaxOptions = { | ||
stripComments?: boolean; | ||
}; | ||
declare function hasESMSyntax(code: string, opts?: DetectSyntaxOptions): boolean; | ||
declare function hasCJSSyntax(code: string, opts?: DetectSyntaxOptions): boolean; | ||
declare function detectSyntax(code: string, opts?: DetectSyntaxOptions): { | ||
hasESM: boolean; | ||
@@ -129,3 +135,3 @@ hasCJS: boolean; | ||
declare function fileURLToPath(id: string): string; | ||
declare function fileURLToPath(id: string | URL): string; | ||
declare function sanitizeURIComponent(name?: string, replacement?: string): string; | ||
@@ -139,2 +145,2 @@ declare function sanitizeFilePath(filePath?: string): string; | ||
export { type CommonjsContext, DYNAMIC_IMPORT_RE, type DeclarationExport, type DefaultExport, type DynamicImport, type ESMExport, type ESMImport, ESM_STATIC_IMPORT_RE, EXPORT_DECAL_RE, EXPORT_DECAL_TYPE_RE, type EvaluateOptions, type NamedExport, type ParsedStaticImport, type ResolveOptions, type StaticImport, type TypeImport, type ValidNodeImportOptions, createCommonJS, createResolve, detectSyntax, evalModule, fileURLToPath, findDynamicImports, findExportNames, findExports, findStaticImports, findTypeExports, findTypeImports, getProtocol, hasCJSSyntax, hasESMSyntax, interopDefault, isNodeBuiltin, isValidNodeImport, loadModule, loadURL, lookupNodeModuleSubpath, normalizeid, parseNodeModulePath, parseStaticImport, parseTypeImport, resolve, resolveImports, resolveModuleExportNames, resolvePath, resolvePathSync, resolveSync, sanitizeFilePath, sanitizeURIComponent, toDataURL, transformModule }; | ||
export { type CommonjsContext, DYNAMIC_IMPORT_RE, type DeclarationExport, type DefaultExport, type DetectSyntaxOptions, type DynamicImport, type ESMExport, type ESMImport, ESM_STATIC_IMPORT_RE, EXPORT_DECAL_RE, EXPORT_DECAL_TYPE_RE, type EvaluateOptions, type NamedExport, type ParsedStaticImport, type ResolveOptions, type StaticImport, type TypeImport, type ValidNodeImportOptions, createCommonJS, createResolve, detectSyntax, evalModule, fileURLToPath, findDynamicImports, findExportNames, findExports, findStaticImports, findTypeExports, findTypeImports, getProtocol, hasCJSSyntax, hasESMSyntax, interopDefault, isNodeBuiltin, isValidNodeImport, loadModule, loadURL, lookupNodeModuleSubpath, normalizeid, parseNodeModulePath, parseStaticImport, parseTypeImport, resolve, resolveImports, resolveModuleExportNames, resolvePath, resolvePathSync, resolveSync, sanitizeFilePath, sanitizeURIComponent, toDataURL, transformModule }; |
{ | ||
"name": "mlly", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "Missing ECMAScript module utils for Node.js", | ||
@@ -29,21 +29,21 @@ "repository": "unjs/mlly", | ||
"dependencies": { | ||
"acorn": "^8.10.0", | ||
"pathe": "^1.1.1", | ||
"acorn": "^8.11.3", | ||
"pathe": "^1.1.2", | ||
"pkg-types": "^1.0.3", | ||
"ufo": "^1.3.0" | ||
"ufo": "^1.3.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.5.9", | ||
"@vitest/coverage-v8": "^0.34.3", | ||
"@types/node": "^20.11.0", | ||
"@vitest/coverage-v8": "^1.1.3", | ||
"changelogen": "^0.5.5", | ||
"eslint": "^8.48.0", | ||
"eslint": "^8.56.0", | ||
"eslint-config-unjs": "^0.2.1", | ||
"import-meta-resolve": "^3.0.0", | ||
"jiti": "^1.19.3", | ||
"prettier": "^3.0.3", | ||
"typescript": "^5.2.2", | ||
"import-meta-resolve": "^4.0.0", | ||
"jiti": "^1.21.0", | ||
"prettier": "^3.1.1", | ||
"typescript": "^5.3.3", | ||
"unbuild": "^2.0.0", | ||
"vitest": "^0.34.3" | ||
"vitest": "^1.1.3" | ||
}, | ||
"packageManager": "pnpm@8.7.0" | ||
"packageManager": "pnpm@8.14.0" | ||
} |
# mlly | ||
[![npm version][npm-version-src]][npm-version-href] | ||
[![npm downloads][npm-downloads-src]][npm-downloads-href] | ||
[![Codecov][codecov-src]][codecov-href] | ||
> Missing [ECMAScript module](https://nodejs.org/api/esm.html) utils for Node.js | ||
@@ -346,3 +350,3 @@ | ||
// ["basename", "dirname", ... ] | ||
console.log(await resolveModuleExportNames("pathe")); | ||
console.log(await resolveModuleExportNames("mlly")); | ||
``` | ||
@@ -473,2 +477,6 @@ | ||
**Options:** | ||
- `preferNamespace`: In case that `default` value exists but is not extendable (when is string for example), return input as-is (default is `false`, meaning `default`'s value is prefered even if cannot be extended) | ||
### `sanitizeURIComponent` | ||
@@ -532,2 +540,11 @@ | ||
[MIT](./LICENSE) - Made with ❤️ | ||
[MIT](./LICENSE) - Made with 💛 | ||
<!-- Badges --> | ||
[npm-version-src]: https://img.shields.io/npm/v/mlly?style=flat&colorA=18181B&colorB=F0DB4F | ||
[npm-version-href]: https://npmjs.com/package/mlly | ||
[npm-downloads-src]: https://img.shields.io/npm/dm/mlly?style=flat&colorA=18181B&colorB=F0DB4F | ||
[npm-downloads-href]: https://npmjs.com/package/mlly | ||
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/mlly/main?style=flat&colorA=18181B&colorB=F0DB4F | ||
[codecov-href]: https://codecov.io/gh/unjs/mlly |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
177883
4884
548
Updatedacorn@^8.11.3
Updatedpathe@^1.1.2
Updatedufo@^1.3.2