Socket
Socket
Sign inDemoInstall

acorn-import-assertions

Package Overview
Dependencies
2
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.7.2 to 1.7.3

16

lib/index.js

@@ -10,2 +10,4 @@ "use strict";

var _charcodes = require("charcodes");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -54,8 +56,16 @@

}
} // ensure that the word is at the correct location
} // ensure that the keyword is at the correct location
// ie `assert{...` or `assert {...`
if (this._codeAt(this.pos + i) !== 32 && this._codeAt(this.pos + i) !== 123) {
return super.readToken(code);
for (;; i++) {
if (this._codeAt(this.pos + i) === _charcodes.leftCurlyBrace) {
// Found '{'
break;
} else if (this._codeAt(this.pos + i) === _charcodes.space) {
// white space is allowed between `assert` and `{`, so continue.
continue;
} else {
return super.readToken(code);
}
} // If we're inside a dynamic import expression we'll parse

@@ -62,0 +72,0 @@ // the `assert` keyword as a standard object property name

6

package.json
{
"name": "acorn-import-assertions",
"version": "1.7.2",
"version": "1.7.3",
"description": "Support for import assertions in acorn",

@@ -38,3 +38,5 @@ "main": "lib/index.js",

},
"dependencies": {},
"dependencies": {
"charcodes": "^0.2.0"
},
"browserslist": [

@@ -41,0 +43,0 @@ "maintained node versions"

import _acorn from "acorn";
import { leftCurlyBrace, space } from "charcodes";

@@ -40,6 +41,14 @@ const keyword = "assert";

// ensure that the word is at the correct location
// ensure that the keyword is at the correct location
// ie `assert{...` or `assert {...`
if (this._codeAt(this.pos + i) !== 32 && this._codeAt(this.pos + i) !== 123) {
return super.readToken(code);
for (;; i++) {
if (this._codeAt(this.pos + i) === leftCurlyBrace) {
// Found '{'
break;
} else if (this._codeAt(this.pos + i) === space) {
// white space is allowed between `assert` and `{`, so continue.
continue;
} else {
return super.readToken(code);
}
}

@@ -46,0 +55,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc