@locker/ast-lib-maker
Advanced tools
Comparing version 0.16.27 to 0.16.28
@@ -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 */ |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24099
515
35
+ Added@locker/shared@0.16.28(transitive)
- Removed@locker/shared@0.16.27(transitive)
Updated@locker/shared@0.16.28