New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@locker/is-module

Package Overview
Dependencies
Maintainers
7
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@locker/is-module - npm Package Compare versions

Comparing version 0.13.8 to 0.13.9

63

dist/index.cjs.js

@@ -1,2 +0,2 @@

/**
/*!
* Copyright (C) 2020 salesforce.com, inc.

@@ -7,40 +7,49 @@ */

var compiler = require('@locker/compiler');
var shared = require('@locker/shared');
const FOUND = {};
function throwFound(func, args) {
shared.ReflectApply(func, this, args);
// eslint-disable-next-line @typescript-eslint/no-throw-literal
throw FOUND;
shared.ReflectApply(func, this, args); // eslint-disable-next-line @typescript-eslint/no-throw-literal
throw FOUND;
}
function parseBlock() {
// Tokenize inner block statements, including function bodies, but don't
// create the AST.
const node = this.startNode();
const { length } = this.context;
do {
this.next();
} while (this.context.length >= length);
// Tokenize inner block statements, including function bodies, but don't
// create the AST.
const node = this.startNode();
const {
length
} = this.context;
do {
this.next();
node.body = [];
return this.finishNode(node, 'BlockStatement');
} while (this.context.length >= length);
this.next();
node.body = [];
return this.finishNode(node, 'BlockStatement');
}
function isModule(code) {
const parser = compiler.Parser.create(code);
parser.parseBlock = parseBlock;
parser.parseExport = shared.wrap(parser.parseExport, throwFound);
parser.parseImport = shared.wrap(parser.parseImport, throwFound);
parser.parseImportMeta = shared.wrap(parser.parseImportMeta, throwFound);
try {
parser.parse();
const parser = compiler.Parser.create(code);
parser.parseBlock = parseBlock;
parser.parseExport = shared.wrap(parser.parseExport, throwFound);
parser.parseImport = shared.wrap(parser.parseImport, throwFound);
parser.parseImportMeta = shared.wrap(parser.parseImportMeta, throwFound);
try {
parser.parse();
} catch (e) {
if (e === FOUND) {
return true;
}
catch (e) {
if (e === FOUND) {
return true;
}
}
return false;
}
return false;
}
module.exports = isModule;
/** version: 0.13.8 */
/*! version: 0.13.9 */

@@ -1,2 +0,2 @@

/**
/*!
* Copyright (C) 2020 salesforce.com, inc.

@@ -6,39 +6,46 @@ */

import { wrap, ReflectApply } from '@locker/shared';
const FOUND = {};
const FOUND = {};
function throwFound(func, args) {
ReflectApply(func, this, args);
// eslint-disable-next-line @typescript-eslint/no-throw-literal
throw FOUND;
ReflectApply(func, this, args); // eslint-disable-next-line @typescript-eslint/no-throw-literal
throw FOUND;
}
function parseBlock() {
// Tokenize inner block statements, including function bodies, but don't
// create the AST.
const node = this.startNode();
const { length } = this.context;
do {
this.next();
} while (this.context.length >= length);
// Tokenize inner block statements, including function bodies, but don't
// create the AST.
const node = this.startNode();
const {
length
} = this.context;
do {
this.next();
node.body = [];
return this.finishNode(node, 'BlockStatement');
} while (this.context.length >= length);
this.next();
node.body = [];
return this.finishNode(node, 'BlockStatement');
}
function isModule(code) {
const parser = Parser.create(code);
parser.parseBlock = parseBlock;
parser.parseExport = wrap(parser.parseExport, throwFound);
parser.parseImport = wrap(parser.parseImport, throwFound);
parser.parseImportMeta = wrap(parser.parseImportMeta, throwFound);
try {
parser.parse();
const parser = Parser.create(code);
parser.parseBlock = parseBlock;
parser.parseExport = wrap(parser.parseExport, throwFound);
parser.parseImport = wrap(parser.parseImport, throwFound);
parser.parseImportMeta = wrap(parser.parseImportMeta, throwFound);
try {
parser.parse();
} catch (e) {
if (e === FOUND) {
return true;
}
catch (e) {
if (e === FOUND) {
return true;
}
}
return false;
}
return false;
}
export default isModule;
/** version: 0.13.8 */
/*! version: 0.13.9 */
{
"name": "@locker/is-module",
"version": "0.13.8",
"version": "0.13.9",
"license": "Salesforce Developer Agreement",

@@ -19,4 +19,4 @@ "author": "Salesforce UI Security Team",

"dependencies": {
"@locker/compiler": "0.13.8",
"@locker/shared": "0.13.8"
"@locker/compiler": "0.13.9",
"@locker/shared": "0.13.9"
},

@@ -30,3 +30,3 @@ "devDependencies": {

],
"gitHead": "7ae9538a6db0e03856a2786175adab87f227853e"
"gitHead": "73a9746ea42f15ee9c1f8c61c9a2135100c96b2c"
}
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