es-module-lexer
Advanced tools
Comparing version 0.1.2 to 0.2.0
{ | ||
"name": "es-module-lexer", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "Lexes ES modules returning their import/export metadata", | ||
"main": "lexer.js", | ||
"main": "dist/lexer.js", | ||
"module": "lexer.js", | ||
"scripts": { | ||
"test": "mocha -r esm -u tdd test/unit.js", | ||
"bench": "node -r esm bench" | ||
"build": "babel lexer.js --out-dir dist", | ||
"bench": "node -r esm bench", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -13,2 +16,6 @@ "author": "Guy Bedford", | ||
"devDependencies": { | ||
"@babel/cli": "^7.5.5", | ||
"@babel/core": "^7.5.5", | ||
"@babel/plugin-transform-modules-commonjs": "^7.5.0", | ||
"babel-plugin-add-module-exports": "^1.0.2", | ||
"esm": "^3.0.84", | ||
@@ -19,4 +26,7 @@ "kleur": "^2.0.2", | ||
}, | ||
"files": ["lexer.js"], | ||
"files": [ | ||
"lexer.js", | ||
"dist" | ||
], | ||
"type": "module" | ||
} |
@@ -52,6 +52,6 @@ # ES Module Lexer | ||
// Dynamic imports are indicated by imports[1].d !== -1 | ||
// Dynamic imports are indicated by imports[1].d > -1 | ||
// In this case the "d" index is the start of the dynamic import | ||
// Returns true | ||
imports[1].d === -1; | ||
imports[1].d > -1; | ||
@@ -65,3 +65,3 @@ // Returns "'asdf'" | ||
// Returns true | ||
imports[2].d === -1; | ||
imports[2].d === -2; | ||
// Returns "import /*comment!*/.meta" | ||
@@ -68,0 +68,0 @@ source.substring(imports[2].s, imports[2].e); |
36401
6
1047
8