Comparing version 0.2.4 to 0.2.5
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.2.5](https://github.com/unjs/mlly/compare/v0.2.4...v0.2.5) (2021-10-05) | ||
### Features | ||
* add `interopDefault` util ([#6](https://github.com/unjs/mlly/issues/6)) ([0c49451](https://github.com/unjs/mlly/commit/0c494516e463956e3ab8f4dede9d22bda2518272)) | ||
### [0.2.4](https://github.com/unjs/mlly/compare/v0.2.3...v0.2.4) (2021-10-01) | ||
@@ -7,0 +14,0 @@ |
@@ -72,1 +72,2 @@ // CommonJS | ||
export function toDataURL(code: string) : string | ||
export function interopDefault<T> (sourceModule: T): 'default' extends keyof T ? T['default'] : T |
{ | ||
"name": "mlly", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Missing ECMAScript module utils for Node.js", | ||
@@ -5,0 +5,0 @@ "repository": "unjs/mlly", |
@@ -319,4 +319,16 @@ # 🤝 mlly | ||
### `interopDefault` | ||
Return the default export of a module at the top-level, alongside any other named exports. | ||
```js | ||
// Assuming the shape { default: { foo: 'bar' }, baz: 'qux' } | ||
import myModule from 'my-module' | ||
// Returns { foo: 'bar', baz: 'qux' } | ||
console.log(interopDefault(myModule)) | ||
``` | ||
## License | ||
MIT |
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
22729
302
334