Socket
Socket
Sign inDemoInstall

lib-esm

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lib-esm - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

6

dist/index.d.ts

@@ -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>;
};

124

dist/index.js
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc