Socket
Socket
Sign inDemoInstall

ascjs

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ascjs - npm Package Compare versions

Comparing version 1.0.3 to 2.0.0

53

index.js

@@ -1,7 +0,30 @@

const esprima = require('esprima');
const parser = require('babylon');
const defaultOptions = {
sourceType: 'module',
jsx: true,
range: true,
tolerant: true
plugins: [
'estree',
'jsx',
'flow',
'typescript',
'doExpressions',
'objectRestSpread',
'decorators',
'decorators2',
'classProperties',
'classPrivateProperties',
'classPrivateMethods',
'exportExtensions',
'asyncGenerators',
'functionBind',
'functionSent',
'dynamicImport',
'numericSeparator',
'optionalChaining',
'importMeta',
'bigInt',
'optionalCatchBinding',
'throwExpressions',
'pipelineOperator',
'nullishCoalescingOperator'
]
};

@@ -13,6 +36,6 @@

const slice = (code, info) => code.slice(info.range[0], info.range[1]);
const slice = (code, info) => code.slice(info.start, info.end);
const chunk = (info, esm, cjs) => ({
start: info.range[0],
end: info.range[1],
start: info.start,
end: info.end,
esm, cjs

@@ -123,6 +146,6 @@ });

const parse = (code, options) => {
code = code.toString();
const out = [];
const chunks = [];
code = code.toString();
esprima.parse(
const parsed = parser.parse(
code,

@@ -133,9 +156,9 @@ Object.assign(

options
),
item => {
if (replace.hasOwnProperty(item.type)) {
chunks.push(replace[item.type](code, item));
}
)
);
parsed.program.body.forEach(item => {
if (replace.hasOwnProperty(item.type)) {
chunks.push(replace[item.type](code, item));
}
);
});
const length = chunks.length;

@@ -142,0 +165,0 @@ let c = 0;

{
"name": "ascjs",
"version": "1.0.3",
"version": "2.0.0",
"description": "ES2015 to CommonJS import/export transformer",

@@ -30,3 +30,3 @@ "bin": "bin.js",

"dependencies": {
"esprima": "^4.0.0"
"babylon": "^6.18.0"
},

@@ -33,0 +33,0 @@ "devDependencies": {

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