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

@locker/ast-lib-maker

Package Overview
Dependencies
Maintainers
8
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@locker/ast-lib-maker - npm Package Compare versions

Comparing version 0.16.27 to 0.16.28

21

dist/index.cjs.js

@@ -15,3 +15,2 @@ /*!

const WINDOW_ALIASES = ['document.defaultView', 'frames', 'globalThis', 'parent', 'self', 'top', 'window'];
const expandPatternsCache = new Map();

@@ -22,6 +21,2 @@ function dehydratePattern(pattern) {

function ensureArray(value) {
return shared.ArrayIsArray(value) ? value : [value];
}
function expandPattern(pattern) {

@@ -129,9 +124,2 @@ const expandedPatterns = [rehydratePattern(normalizePattern(pattern))];

expandPatterns(patterns) {
const cacheKey = shared.JSONStringify(patterns);
const cachedValue = expandPatternsCache.get(cacheKey);
if (cachedValue) {
return shared.JSONParse(cachedValue);
}
const expandedPatterns = patterns.map(pattern => rehydratePattern(normalizePattern(pattern)) // eslint-disable-next-line function-paren-newline

@@ -159,3 +147,2 @@ );

expandPatternsCache.set(cacheKey, shared.JSONStringify(expandedPatterns));
return expandedPatterns;

@@ -202,8 +189,6 @@ },

match(identifier, patterns) {
const expandedPatterns = this.expandPatterns(ensureArray(patterns));
expandedLoop: for (let i = 0, {
length
} = expandedPatterns; i < length; i += 1) {
const arrayPattern = expandedPatterns[i]; // Skip fast for mismatched identifiers.
} = patterns; i < length; i += 1) {
const arrayPattern = patterns[i]; // Skip fast for mismatched identifiers.

@@ -310,2 +295,2 @@ if (!this.isNodeByAsteriskOrName(identifier, arrayPattern[0])) {

exports.createLib = createLib;
/*! version: 0.16.27 */
/*! version: 0.16.28 */
/*!
* Copyright (C) 2020 salesforce.com, inc.
*/
import { JSONStringify, JSONParse, ArrayIsArray } from '@locker/shared';
import { ArrayIsArray } from '@locker/shared';
const ASTERISK_CHARACTER = '*';
const DOCUMENT_ALIASES = [`${ASTERISK_CHARACTER}.ownerDocument`, 'document'];
const WINDOW_ALIASES = ['document.defaultView', 'frames', 'globalThis', 'parent', 'self', 'top', 'window'];
const expandPatternsCache = new Map();

@@ -14,6 +13,2 @@ function dehydratePattern(pattern) {

function ensureArray(value) {
return ArrayIsArray(value) ? value : [value];
}
function expandPattern(pattern) {

@@ -121,9 +116,2 @@ const expandedPatterns = [rehydratePattern(normalizePattern(pattern))];

expandPatterns(patterns) {
const cacheKey = JSONStringify(patterns);
const cachedValue = expandPatternsCache.get(cacheKey);
if (cachedValue) {
return JSONParse(cachedValue);
}
const expandedPatterns = patterns.map(pattern => rehydratePattern(normalizePattern(pattern)) // eslint-disable-next-line function-paren-newline

@@ -151,3 +139,2 @@ );

expandPatternsCache.set(cacheKey, JSONStringify(expandedPatterns));
return expandedPatterns;

@@ -194,8 +181,6 @@ },

match(identifier, patterns) {
const expandedPatterns = this.expandPatterns(ensureArray(patterns));
expandedLoop: for (let i = 0, {
length
} = expandedPatterns; i < length; i += 1) {
const arrayPattern = expandedPatterns[i]; // Skip fast for mismatched identifiers.
} = patterns; i < length; i += 1) {
const arrayPattern = patterns[i]; // Skip fast for mismatched identifiers.

@@ -302,2 +287,2 @@ if (!this.isNodeByAsteriskOrName(identifier, arrayPattern[0])) {

export { createLib };
/*! version: 0.16.27 */
/*! version: 0.16.28 */

7

package.json
{
"name": "@locker/ast-lib-maker",
"version": "0.16.27",
"version": "0.16.28",
"license": "Salesforce Developer Agreement",

@@ -26,3 +26,3 @@ "author": "Salesforce UI Security Team",

"dependencies": {
"@locker/shared": "0.16.27"
"@locker/shared": "0.16.28"
},

@@ -35,4 +35,3 @@ "devDependencies": {

"types/"
],
"gitHead": "acad2547d1054cc72fff992dd58858a573b6ac14"
]
}

@@ -29,4 +29,4 @@ import * as ESTree from 'estree';

isNonComputedMemberExpressionNode(node: AST.MaybeNode): boolean;
match(identifier: AST.IdentifierOrThisExpression, patterns: Lib.SearchPatternArray[] | Lib.SearchPattern): Lib.MatchData | undefined;
matchAll(identifiers: AST.IdentifierOrThisExpression[], patterns: Lib.SearchPatternArray[] | Lib.SearchPattern): Lib.MatchData[];
match(identifier: AST.IdentifierOrThisExpression, patterns: Lib.SearchPatternArray[]): Lib.MatchData | undefined;
matchAll(identifiers: AST.IdentifierOrThisExpression[], patterns: Lib.SearchPatternArray[]): Lib.MatchData[];
};

@@ -33,0 +33,0 @@ export declare function createLib(overrides?: CreateLib.Overrides): typeof baseLib;

Sorry, the diff of this file is not supported yet

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