Comparing version 0.4.0 to 0.4.1
@@ -19,8 +19,12 @@ export interface Options { | ||
} | ||
/** Lib to ESM code snippet. */ | ||
/** Lib to ESM code snippets */ | ||
export default function libEsm(options: Options): { | ||
/** `window[iife-name]` snippets */ | ||
window: string; | ||
/** `require(id)` snippets */ | ||
require: string; | ||
/** `export` snippets */ | ||
exports: string; | ||
/** Keywords alias */ | ||
keywords: Record<string, string>; | ||
}; |
"use strict"; | ||
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); | ||
const keywords = [ | ||
"break", | ||
"case", | ||
"catch", | ||
"class", | ||
"const", | ||
"continue", | ||
"debugger", | ||
"default", | ||
"delete", | ||
"do", | ||
"else", | ||
"export", | ||
"extends", | ||
"false", | ||
"finally", | ||
"for", | ||
"function", | ||
"if", | ||
"import", | ||
"in", | ||
"instanceof", | ||
"new", | ||
"null", | ||
"return", | ||
"super", | ||
"switch", | ||
"this", | ||
"throw", | ||
"true", | ||
"try", | ||
"typeof", | ||
"var", | ||
"void", | ||
"while", | ||
"with" | ||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#reserved_words | ||
...[ | ||
"break", | ||
"case", | ||
"catch", | ||
"class", | ||
"const", | ||
"continue", | ||
"debugger", | ||
"default", | ||
"delete", | ||
"do", | ||
"else", | ||
"export", | ||
"extends", | ||
"false", | ||
"finally", | ||
"for", | ||
"function", | ||
"if", | ||
"import", | ||
"in", | ||
"instanceof", | ||
"new", | ||
"null", | ||
"return", | ||
"super", | ||
"switch", | ||
"this", | ||
"throw", | ||
"true", | ||
"try", | ||
"typeof", | ||
"var", | ||
"void", | ||
"while", | ||
"with", | ||
// The following are only reserved when they are found in strict mode code | ||
"const", | ||
"let", | ||
"static", | ||
"yield", | ||
// The following are only reserved when they are found in module code or async function bodies | ||
"await" | ||
], | ||
...[ | ||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#future_reserved_words | ||
"enum", | ||
// The following are only reserved when they are found in strict mode code | ||
"implements", | ||
"interface", | ||
"package", | ||
"private", | ||
"protected", | ||
"public", | ||
// Future reserved words in older standards | ||
// The following are reserved as future keywords by older ECMAScript specifications (ECMAScript 1 till 3). | ||
"abstract", | ||
"boolean", | ||
"byte", | ||
"char", | ||
"double", | ||
"final", | ||
"float", | ||
"goto", | ||
"int", | ||
"long", | ||
"native", | ||
"short", | ||
"synchronized", | ||
"throws", | ||
"transient", | ||
"volatile" | ||
], | ||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers_with_special_meanings | ||
...[ | ||
"arguments", | ||
"as", | ||
"async", | ||
"eval", | ||
"from", | ||
"get", | ||
"of", | ||
"set" | ||
] | ||
]; | ||
@@ -66,5 +116,9 @@ function libEsm(options) { | ||
return { | ||
/** `window[iife-name]` snippets */ | ||
window: windowSnippet, | ||
/** `require(id)` snippets */ | ||
require: requireSnippet, | ||
/** `export` snippets */ | ||
exports: exportsSnippet, | ||
/** Keywords alias */ | ||
keywords: alias | ||
@@ -71,0 +125,0 @@ }; |
{ | ||
"name": "lib-esm", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Lib to ESM snippet.", | ||
@@ -23,3 +23,3 @@ "main": "./dist/index.js", | ||
"types": "tsc", | ||
"prepublishOnly": "npm run test && npm run build" | ||
"prepublishOnly": "npm run build && npm run test" | ||
}, | ||
@@ -26,0 +26,0 @@ "files": [ |
@@ -19,3 +19,3 @@ # lib-esm | ||
// or | ||
// const libEsm = require('lib-esm') | ||
// const libEsm = require('lib-esm').default | ||
@@ -62,3 +62,3 @@ const result = libEsm({ | ||
```ts | ||
/** Lib to ESM code snippet. */ | ||
/** Lib to ESM code snippets */ | ||
function libEsm(options: { | ||
@@ -82,7 +82,7 @@ /** | ||
}): { | ||
/** `window[iife-name]` snippets. */ | ||
/** `window[iife-name]` snippets */ | ||
window: string; | ||
/** `require(id)` snippets. */ | ||
/** `require(id)` snippets */ | ||
require: string; | ||
/** `export` snippets. */ | ||
/** `export` snippets */ | ||
exports: string; | ||
@@ -89,0 +89,0 @@ /** Keywords alias */ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
10216
281
0