Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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 3.1.2 to 4.0.0

51

index.js
'use strict';
const parser = require('babylon');
const parser = require('@babel/parser');
const defaultOptions = {
allowAwaitOutsideFunction: true,
sourceType: 'module',

@@ -8,24 +9,27 @@ plugins: [

'jsx',
'flow',
'typescript',
'doExpressions',
'objectRestSpread',
'decorators',
'decorators2',
'exportExtensions',
'exportDefaultFrom',
'exportNamespaceFrom',
'dynamicImport',
'importMeta',
'asyncGenerators',
'bigInt',
'classProperties',
'classPrivateProperties',
'classPrivateMethods',
'exportExtensions',
'asyncGenerators',
['decorators', {decoratorsBeforeExport: true}],
'doExpressions',
'functionBind',
'functionSent',
'dynamicImport',
'logicalAssignment',
'nullishCoalescingOperator',
'numericSeparator',
'objectRestSpread',
'optionalCatchBinding',
'optionalChaining',
'importMeta',
'bigInt',
'optionalCatchBinding',
'partialApplication',
['pipelineOperator', {proposal: 'minimal'}],
'throwExpressions',
'pipelineOperator',
'nullishCoalescingOperator'
'topLevelAwait'
]

@@ -151,2 +155,7 @@ };

if (!options) options = {};
const parserOptions = Object.assign(
{},
defaultOptions,
options
);
parse.info = {

@@ -161,10 +170,3 @@ EXPORT: options.EXPORT || EXPORT,

const chunks = [];
const parsed = parser.parse(
code,
Object.assign(
{},
defaultOptions,
options
)
);
const parsed = parser.parse(code, parserOptions);
parsed.program.body.forEach(item => {

@@ -185,3 +187,6 @@ if (replace.hasOwnProperty(item.type)) {

out.push(length ? code.slice(c) : code);
const result = out.join('');
let result = out.join('').replace(
/\bimport\.meta\b/g,
"({url: require('url').pathToFileURL(__filename).href})"
);
return /^(?:#!|['"]use strict['"])/.test(result.trim()) ?

@@ -188,0 +193,0 @@ result :

{
"name": "ascjs",
"version": "3.1.2",
"version": "4.0.0",
"description": "ES2015 to CommonJS import/export transformer",

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

"dependencies": {
"babylon": "^6.18.0"
"@babel/parser": "^7.9.4"
},
"devDependencies": {
"coveralls": "^3.0.8",
"coveralls": "^3.0.11",
"istanbul": "^0.4.5"
}
}
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