@chialab/cjs-to-esm
Advanced tools
Comparing version 0.17.5 to 0.17.6
@@ -13,24 +13,23 @@ import { TokenType, extractFunctionArguments, getNextToken, nextBlock } from '@chialab/estransform'; | ||
} | ||
if (processor.identifierNameForToken(token) !== 'module') { | ||
return false; | ||
if (processor.identifierNameForToken(token) === 'module') { | ||
token = getNextToken(processor); | ||
if (token.type !== TokenType.dot) { | ||
return false; | ||
} | ||
token = getNextToken(processor); | ||
if (token.type !== TokenType.name) { | ||
return false; | ||
} | ||
if (processor.identifierNameForToken(token) !== 'exports') { | ||
return false; | ||
} | ||
token = getNextToken(processor); | ||
if (token.type !== TokenType.eq) { | ||
return false; | ||
} | ||
token = getNextToken(processor); | ||
if (token.type !== TokenType.name) { | ||
return false; | ||
} | ||
} | ||
token = getNextToken(processor); | ||
if (token.type !== TokenType.dot) { | ||
return false; | ||
} | ||
token = getNextToken(processor); | ||
if (token.type !== TokenType.name) { | ||
return false; | ||
} | ||
if (processor.identifierNameForToken(token) !== 'exports') { | ||
return false; | ||
} | ||
token = getNextToken(processor); | ||
if (token.type !== TokenType.eq) { | ||
return false; | ||
} | ||
token = getNextToken(processor); | ||
if (token.type !== TokenType.name) { | ||
return false; | ||
} | ||
if (processor.identifierNameForToken(token) !== args[1]) { | ||
@@ -37,0 +36,0 @@ return false; |
{ | ||
"name": "@chialab/cjs-to-esm", | ||
"type": "module", | ||
"version": "0.17.5", | ||
"version": "0.17.6", | ||
"description": "A commonjs to esm converter.", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
36978
932