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

@locker/shared

Package Overview
Dependencies
Maintainers
6
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@locker/shared - npm Package Compare versions

Comparing version 0.13.1 to 0.13.2

285

dist/index.cjs.js

@@ -9,59 +9,32 @@ /**

const { apply: ReflectApply, construct: ReflectConstruct, deleteProperty: ReflectDeleteProperty, has: ReflectHas, get: ReflectGet, getPrototypeOf: ReflectGetPrototypeOf, set: ReflectSet, setPrototypeOf: ReflectSetPrototypeOf, defineProperty: ReflectDefineProperty, isExtensible: ReflectIsExtensible, getOwnPropertyDescriptor: ReflectGetOwnPropertyDescriptor, ownKeys: ReflectOwnKeys, preventExtensions: ReflectPreventExtensions, } = Reflect;
function ReflectGetSafeOwnPropertyDescriptor(target, key) {
const descriptor = ReflectGetOwnPropertyDescriptor(target, key);
if (descriptor) {
return toSafeDescriptor(descriptor);
}
return descriptor;
}
const {
// eslint-disable-next-line @typescript-eslint/naming-convention
__lookupGetter__: ObjectProto__lookupGetter__,
// eslint-disable-next-line @typescript-eslint/naming-convention
__lookupSetter__: ObjectProto__lookupSetter__, hasOwnProperty: ObjectProtoHasOwnProperty, } = Object.prototype;
const { assign: ObjectAssign, create: ObjectCreate, defineProperty: ObjectDefineProperty, defineProperties: ObjectDefineProperties, getOwnPropertyDescriptors: ObjectGetOwnPropertyDescriptors, freeze: ObjectFreeze, getOwnPropertyNames: ObjectGetOwnPropertyNames, getOwnPropertySymbols: ObjectGetOwnPropertySymbols, keys: ObjectKeys, seal: ObjectSeal, isSealed: ObjectIsSealed, isFrozen: ObjectIsFrozen, preventExtensions: ObjectPreventExtensions, } = Object;
function ObjectGetSafeOwnPropertyDescriptors(target) {
return toSafeDescriptorMap(ObjectGetOwnPropertyDescriptors(target));
const { concat: ArrayProtoConcat, filter: ArrayProtoFilter, includes: ArrayProtoIncludes, join: ArrayProtoJoin, slice: ArrayProtoSlice, } = Array.prototype;
const ArrayCtor = Array;
const { from: ArrayFrom, isArray: ArrayIsArray } = Array;
const { push: ArrayProtoPush } = Array.prototype;
function ArrayConcat(arr, ...args) {
return ReflectApply(ArrayProtoConcat, arr, args);
}
function ObjectHasOwnProperty(obj, key) {
return obj !== null && obj !== undefined && ReflectApply(ObjectProtoHasOwnProperty, obj, [key]);
function ArrayFilter(arr, iteratee) {
return ReflectApply(ArrayProtoFilter, arr, [iteratee]);
}
function ObjectLookupOwnGetter(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return ReflectApply(ObjectProto__lookupGetter__, obj, [key]);
function ArrayIncludes(arr, value) {
return ReflectApply(ArrayProtoIncludes, arr, [value]);
}
function ObjectLookupOwnSetter(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return ReflectApply(ObjectProto__lookupSetter__, obj, [key]);
function ArrayJoin(arr, ...args) {
return ReflectApply(ArrayProtoJoin, arr, args);
}
function ObjectLookupOwnValue(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return obj[key];
function ArrayPush(arr, ...args) {
return ReflectApply(ArrayProtoPush, arr, args);
}
function createSafeObject(target) {
// Create a shallow copy with null prototype and safe descriptors.
return ObjectCreate(null, ObjectGetSafeOwnPropertyDescriptors(target));
function ArrayShallowClone(arr) {
return ArraySlice(arr, 0);
}
function defaults(target, source) {
if (typeof target === 'function' || (typeof target === 'object' && target !== null)) {
const props = ReflectOwnKeys(source);
for (let i = 0, len = props.length; i < len; i += 1) {
const name = props[i];
if (target[name] === undefined ||
!ReflectApply(ObjectProtoHasOwnProperty, target, [name])) {
target[name] = source[name];
}
}
}
return target;
function ArraySlice(arr, ...args) {
return ReflectApply(ArrayProtoSlice, arr, args);
}
const emptyArray = [];
const { apply: ReflectApply$1, ownKeys: ReflectOwnKeys$1, setPrototypeOf: ReflectSetPrototypeOf$1, } = Reflect;
const { create: ObjectCreate } = Object;
const { ownKeys: ReflectOwnKeys$1, setPrototypeOf: ReflectSetPrototypeOf$1 } = Reflect;
function isObject(value) {

@@ -73,5 +46,10 @@ return typeof value === 'object' && value !== null;

}
function toSafeDescriptor(descriptor) {
ReflectSetPrototypeOf$1(descriptor, null);
return descriptor;
function shallowCloneOptions(options) {
const keys = ReflectOwnKeys$1(options);
const clone = ObjectCreate(null);
for (let i = 0, len = keys.length; i < len; i += 1) {
const key = keys[i];
clone[key] = options[key];
}
return clone;
}

@@ -91,27 +69,3 @@ function toSafeDescriptorMap(descriptorMap) {

}
function unapply(func) {
return (thisArg, ...args) => ReflectApply$1(func, thisArg, args);
}
function shallowCloneOptions(options) {
const keys = ReflectOwnKeys$1(options);
const clone = ObjectCreate(null);
for (let i = 0, len = keys.length; i < len; i += 1) {
const key = keys[i];
clone[key] = options[key];
}
return clone;
}
const ArrayCtor = Array;
const { from: ArrayFrom, isArray: ArrayIsArray } = Array;
const { push: ArrayProtoPush } = Array.prototype;
const ArrayConcat = unapply(Array.prototype.concat);
const ArrayFilter = unapply(Array.prototype.filter);
const ArrayIncludes = unapply(Array.prototype.includes);
const ArrayJoin = unapply(Array.prototype.join);
const ArrayPush = unapply(ArrayProtoPush);
const ArraySlice = unapply(Array.prototype.slice);
const ArrayShallowClone = (arr) => ArraySlice(arr, 0);
const emptyArray = [];
function toBoolean(value) {

@@ -121,2 +75,30 @@ return !!value;

const {
// eslint-disable-next-line @typescript-eslint/naming-convention
__lookupGetter__: ObjectProto__lookupGetter__,
// eslint-disable-next-line @typescript-eslint/naming-convention
__lookupSetter__: ObjectProto__lookupSetter__, hasOwnProperty: ObjectProtoHasOwnProperty, } = Object.prototype;
const { assign: ObjectAssign, create: ObjectCreate$1, defineProperty: ObjectDefineProperty, defineProperties: ObjectDefineProperties, getOwnPropertyDescriptors: ObjectGetOwnPropertyDescriptors, freeze: ObjectFreeze, getOwnPropertyNames: ObjectGetOwnPropertyNames, getOwnPropertySymbols: ObjectGetOwnPropertySymbols, keys: ObjectKeys, seal: ObjectSeal, isSealed: ObjectIsSealed, isFrozen: ObjectIsFrozen, preventExtensions: ObjectPreventExtensions, } = Object;
function ObjectHasOwnProperty(obj, key) {
return obj !== null && obj !== undefined && ReflectApply(ObjectProtoHasOwnProperty, obj, [key]);
}
function ObjectLookupOwnGetter(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return ReflectApply(ObjectProto__lookupGetter__, obj, [key]);
}
function ObjectLookupOwnSetter(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return ReflectApply(ObjectProto__lookupSetter__, obj, [key]);
}
function ObjectLookupOwnValue(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return obj[key];
}
const ProxyCtor = Proxy;

@@ -143,3 +125,3 @@ const ProxyRevocable = Proxy.revocable;

function createRevokedProxy(object) {
const revocable = ProxyRevocable(object, ObjectCreate(null));
const revocable = ProxyRevocable(object, ObjectCreate$1(null));
revocable.revoke();

@@ -168,29 +150,75 @@ return revocable.proxy;

const { for: SymbolFor, iterator: SymbolIterator } = Symbol;
const { entries: MapProtoEntries, forEach: MapProtoForEach, set: MapProtoSet } = Map.prototype;
const MapCtor = Map;
const MapEntries = unapply(Map.prototype.entries);
const MapForEach = unapply(Map.prototype.forEach);
const MapGet = unapply(Map.prototype.get);
const MapSet = unapply(Map.prototype.set);
const MapIteratorCreate = unapply(Map.prototype[SymbolIterator]);
function MapConcat(...maps) {
const map = new MapCtor();
for (let i = 0, len = maps.length; i < len; i += 1) {
const m = maps[i];
MapForEach(m, (v, k) => {
MapSet(map, k, v);
});
}
return map;
function MapEntries(map) {
return ReflectApply(MapProtoEntries, map, emptyArray);
}
function MapForEach(map, iteratee) {
return ReflectApply(MapProtoForEach, map, [iteratee]);
}
function MapSet(map, key, value) {
return ReflectApply(MapProtoSet, map, [key, value]);
}
const MathMin = Math.min;
const PromiseThen = unapply(Promise.prototype.then);
const { then: PromiseProtoThen } = Promise.prototype;
function PromiseThen(promise, ...args) {
return ReflectApply(PromiseProtoThen, promise, [args]);
}
const StringCtor = String;
const { charCodeAt: StringProtoCharCodeAt, includes: StringProtoIncludes, match: StringProtoMatch, replace: StringProtoReplace, slice: StringProtoSlice, split: StringProtoSplit, substring: StringProtoSubstring, startsWith: StringProtoStartsWith, toLowerCase: StringProtoToLowerCase, toUpperCase: StringProtoToUpperCase, } = String.prototype;
function StringCharCodeAt(str, index) {
return ReflectApply(StringProtoCharCodeAt, str, [index]);
}
function StringIncludes(str, ...args) {
return ReflectApply(StringProtoIncludes, str, args);
}
function StringMatch(str, regexp) {
return ReflectApply(StringProtoMatch, str, [regexp]);
}
function StringReplace(str, pattern, replacement) {
return ReflectApply(StringProtoReplace, str, [pattern, replacement]);
}
function StringSlice(str, ...args) {
return ReflectApply(StringProtoSlice, str, args);
}
function StringSplit(str, ...args) {
return ReflectApply(StringProtoSplit, str, args);
}
function StringSubstring(str, ...args) {
return ReflectApply(StringProtoSubstring, str, args);
}
function StringStartsWith(str, ...args) {
return ReflectApply(StringProtoStartsWith, str, args);
}
function StringToLowerCase(str) {
return ReflectApply(StringProtoToLowerCase, str, emptyArray);
}
function StringToUpperCase(str) {
return ReflectApply(StringProtoToUpperCase, str, emptyArray);
}
function capitalize(str) {
return str.length ? `${StringToUpperCase(str[0])}${StringSlice(str, 1)}` : '';
}
function toString(value) {
try {
return StringCtor(value);
}
catch (_a) {
return '';
}
}
function toStringIfNotNullOrUndefined(value) {
return value === null || value === undefined ? value : toString(value);
}
const { test: RegExpProtoTest } = RegExp.prototype;
const specialCharRegExp = /[\\^$.*+?()[\]{}|]/g;
const RegExpTest = unapply(RegExp.prototype.test);
function RegExpTest(regexp, content) {
return ReflectApply(RegExpProtoTest, regexp, [content]);
}
function escapeRegExp(string) {
return string.replace(specialCharRegExp, '\\$&');
return StringReplace(string, specialCharRegExp, '\\$&');
}

@@ -213,41 +241,24 @@

const { add: SetProtoAdd, delete: SetProtoDelete, has: SetProtoHas } = Set.prototype;
const SetCtor = Set;
const SetAdd = unapply(Set.prototype.add);
const SetDelete = unapply(Set.prototype.delete);
const SetHas = unapply(Set.prototype.has);
const StringCharAt = unapply(String.prototype.charAt);
const StringCharCodeAt = unapply(String.prototype.charCodeAt);
const StringIndexOf = unapply(String.prototype.indexOf);
const StringMatch = unapply(String.prototype.match);
const StringReplace = unapply(String.prototype.replace);
const StringSlice = unapply(String.prototype.slice);
const StringSplit = unapply(String.prototype.split);
const StringSubstring = unapply(String.prototype.substring);
const StringStartsWith = unapply(String.prototype.startsWith);
const StringToLowerCase = unapply(String.prototype.toLowerCase);
const StringToUpperCase = unapply(String.prototype.toUpperCase);
const StringEndsWith = unapply(String.prototype.endsWith);
const StringTrim = unapply(String.prototype.trim);
const StringIncludes = unapply(String.prototype.includes);
const StringCtor = String;
function toString(value) {
try {
return StringCtor(value);
}
catch (_a) {
return '';
}
function SetAdd(set, value) {
return ReflectApply(SetProtoAdd, set, [value]);
}
function toStringIfNotNullOrUndefined(value) {
return value === null || value === undefined ? value : toString(value);
function SetDelete(set, value) {
return ReflectApply(SetProtoDelete, set, [value]);
}
function capitalize(value) {
return value.length ? `${StringToUpperCase(value[0])}${StringSlice(value, 1)}` : '';
function SetHas(set, value) {
return ReflectApply(SetProtoHas, set, [value]);
}
const { for: SymbolFor, iterator: SymbolIterator } = Symbol;
const { get: WeakMapProtoGet, set: WeakMapProtoSet } = WeakMap.prototype;
const WeakMapCtor = WeakMap;
const WeakMapGet = unapply(WeakMap.prototype.get);
const WeakMapHas = unapply(WeakMap.prototype.has);
const WeakMapSet = unapply(WeakMap.prototype.set);
function WeakMapGet(weakMap, key) {
return ReflectApply(WeakMapProtoGet, weakMap, [key]);
}
function WeakMapSet(weakMap, key, value) {
return ReflectApply(WeakMapProtoSet, weakMap, [key, value]);
}

@@ -285,12 +296,9 @@ const SYMBOL_LIVE_OBJECT = SymbolFor('@@lockerLiveValue');

exports.LockerSecurityError = LockerSecurityError;
exports.MapConcat = MapConcat;
exports.MapCtor = MapCtor;
exports.MapEntries = MapEntries;
exports.MapForEach = MapForEach;
exports.MapGet = MapGet;
exports.MapIteratorCreate = MapIteratorCreate;
exports.MapSet = MapSet;
exports.MathMin = MathMin;
exports.ObjectAssign = ObjectAssign;
exports.ObjectCreate = ObjectCreate;
exports.ObjectCreate = ObjectCreate$1;
exports.ObjectDefineProperties = ObjectDefineProperties;

@@ -302,3 +310,2 @@ exports.ObjectDefineProperty = ObjectDefineProperty;

exports.ObjectGetOwnPropertySymbols = ObjectGetOwnPropertySymbols;
exports.ObjectGetSafeOwnPropertyDescriptors = ObjectGetSafeOwnPropertyDescriptors;
exports.ObjectHasOwnProperty = ObjectHasOwnProperty;

@@ -324,3 +331,2 @@ exports.ObjectIsFrozen = ObjectIsFrozen;

exports.ReflectGetPrototypeOf = ReflectGetPrototypeOf;
exports.ReflectGetSafeOwnPropertyDescriptor = ReflectGetSafeOwnPropertyDescriptor;
exports.ReflectHas = ReflectHas;

@@ -338,7 +344,4 @@ exports.ReflectIsExtensible = ReflectIsExtensible;

exports.SetHas = SetHas;
exports.StringCharAt = StringCharAt;
exports.StringCharCodeAt = StringCharCodeAt;
exports.StringEndsWith = StringEndsWith;
exports.StringIncludes = StringIncludes;
exports.StringIndexOf = StringIndexOf;
exports.StringMatch = StringMatch;

@@ -352,3 +355,2 @@ exports.StringReplace = StringReplace;

exports.StringToUpperCase = StringToUpperCase;
exports.StringTrim = StringTrim;
exports.SymbolFor = SymbolFor;

@@ -359,8 +361,5 @@ exports.SymbolIterator = SymbolIterator;

exports.WeakMapGet = WeakMapGet;
exports.WeakMapHas = WeakMapHas;
exports.WeakMapSet = WeakMapSet;
exports.capitalize = capitalize;
exports.createRevokedProxy = createRevokedProxy;
exports.createSafeObject = createSafeObject;
exports.defaults = defaults;
exports.emptyArray = emptyArray;

@@ -377,8 +376,6 @@ exports.escapeRegExp = escapeRegExp;

exports.toIgnore = toIgnore;
exports.toSafeDescriptor = toSafeDescriptor;
exports.toSafeDescriptorMap = toSafeDescriptorMap;
exports.toString = toString;
exports.toStringIfNotNullOrUndefined = toStringIfNotNullOrUndefined;
exports.unapply = unapply;
exports.wrap = wrap;
/** version: 0.13.1 */
/** version: 0.13.2 */

@@ -5,59 +5,32 @@ /**

const { apply: ReflectApply, construct: ReflectConstruct, deleteProperty: ReflectDeleteProperty, has: ReflectHas, get: ReflectGet, getPrototypeOf: ReflectGetPrototypeOf, set: ReflectSet, setPrototypeOf: ReflectSetPrototypeOf, defineProperty: ReflectDefineProperty, isExtensible: ReflectIsExtensible, getOwnPropertyDescriptor: ReflectGetOwnPropertyDescriptor, ownKeys: ReflectOwnKeys, preventExtensions: ReflectPreventExtensions, } = Reflect;
function ReflectGetSafeOwnPropertyDescriptor(target, key) {
const descriptor = ReflectGetOwnPropertyDescriptor(target, key);
if (descriptor) {
return toSafeDescriptor(descriptor);
}
return descriptor;
}
const {
// eslint-disable-next-line @typescript-eslint/naming-convention
__lookupGetter__: ObjectProto__lookupGetter__,
// eslint-disable-next-line @typescript-eslint/naming-convention
__lookupSetter__: ObjectProto__lookupSetter__, hasOwnProperty: ObjectProtoHasOwnProperty, } = Object.prototype;
const { assign: ObjectAssign, create: ObjectCreate, defineProperty: ObjectDefineProperty, defineProperties: ObjectDefineProperties, getOwnPropertyDescriptors: ObjectGetOwnPropertyDescriptors, freeze: ObjectFreeze, getOwnPropertyNames: ObjectGetOwnPropertyNames, getOwnPropertySymbols: ObjectGetOwnPropertySymbols, keys: ObjectKeys, seal: ObjectSeal, isSealed: ObjectIsSealed, isFrozen: ObjectIsFrozen, preventExtensions: ObjectPreventExtensions, } = Object;
function ObjectGetSafeOwnPropertyDescriptors(target) {
return toSafeDescriptorMap(ObjectGetOwnPropertyDescriptors(target));
const { concat: ArrayProtoConcat, filter: ArrayProtoFilter, includes: ArrayProtoIncludes, join: ArrayProtoJoin, slice: ArrayProtoSlice, } = Array.prototype;
const ArrayCtor = Array;
const { from: ArrayFrom, isArray: ArrayIsArray } = Array;
const { push: ArrayProtoPush } = Array.prototype;
function ArrayConcat(arr, ...args) {
return ReflectApply(ArrayProtoConcat, arr, args);
}
function ObjectHasOwnProperty(obj, key) {
return obj !== null && obj !== undefined && ReflectApply(ObjectProtoHasOwnProperty, obj, [key]);
function ArrayFilter(arr, iteratee) {
return ReflectApply(ArrayProtoFilter, arr, [iteratee]);
}
function ObjectLookupOwnGetter(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return ReflectApply(ObjectProto__lookupGetter__, obj, [key]);
function ArrayIncludes(arr, value) {
return ReflectApply(ArrayProtoIncludes, arr, [value]);
}
function ObjectLookupOwnSetter(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return ReflectApply(ObjectProto__lookupSetter__, obj, [key]);
function ArrayJoin(arr, ...args) {
return ReflectApply(ArrayProtoJoin, arr, args);
}
function ObjectLookupOwnValue(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return obj[key];
function ArrayPush(arr, ...args) {
return ReflectApply(ArrayProtoPush, arr, args);
}
function createSafeObject(target) {
// Create a shallow copy with null prototype and safe descriptors.
return ObjectCreate(null, ObjectGetSafeOwnPropertyDescriptors(target));
function ArrayShallowClone(arr) {
return ArraySlice(arr, 0);
}
function defaults(target, source) {
if (typeof target === 'function' || (typeof target === 'object' && target !== null)) {
const props = ReflectOwnKeys(source);
for (let i = 0, len = props.length; i < len; i += 1) {
const name = props[i];
if (target[name] === undefined ||
!ReflectApply(ObjectProtoHasOwnProperty, target, [name])) {
target[name] = source[name];
}
}
}
return target;
function ArraySlice(arr, ...args) {
return ReflectApply(ArrayProtoSlice, arr, args);
}
const emptyArray = [];
const { apply: ReflectApply$1, ownKeys: ReflectOwnKeys$1, setPrototypeOf: ReflectSetPrototypeOf$1, } = Reflect;
const { create: ObjectCreate } = Object;
const { ownKeys: ReflectOwnKeys$1, setPrototypeOf: ReflectSetPrototypeOf$1 } = Reflect;
function isObject(value) {

@@ -69,5 +42,10 @@ return typeof value === 'object' && value !== null;

}
function toSafeDescriptor(descriptor) {
ReflectSetPrototypeOf$1(descriptor, null);
return descriptor;
function shallowCloneOptions(options) {
const keys = ReflectOwnKeys$1(options);
const clone = ObjectCreate(null);
for (let i = 0, len = keys.length; i < len; i += 1) {
const key = keys[i];
clone[key] = options[key];
}
return clone;
}

@@ -87,27 +65,3 @@ function toSafeDescriptorMap(descriptorMap) {

}
function unapply(func) {
return (thisArg, ...args) => ReflectApply$1(func, thisArg, args);
}
function shallowCloneOptions(options) {
const keys = ReflectOwnKeys$1(options);
const clone = ObjectCreate(null);
for (let i = 0, len = keys.length; i < len; i += 1) {
const key = keys[i];
clone[key] = options[key];
}
return clone;
}
const ArrayCtor = Array;
const { from: ArrayFrom, isArray: ArrayIsArray } = Array;
const { push: ArrayProtoPush } = Array.prototype;
const ArrayConcat = unapply(Array.prototype.concat);
const ArrayFilter = unapply(Array.prototype.filter);
const ArrayIncludes = unapply(Array.prototype.includes);
const ArrayJoin = unapply(Array.prototype.join);
const ArrayPush = unapply(ArrayProtoPush);
const ArraySlice = unapply(Array.prototype.slice);
const ArrayShallowClone = (arr) => ArraySlice(arr, 0);
const emptyArray = [];
function toBoolean(value) {

@@ -117,2 +71,30 @@ return !!value;

const {
// eslint-disable-next-line @typescript-eslint/naming-convention
__lookupGetter__: ObjectProto__lookupGetter__,
// eslint-disable-next-line @typescript-eslint/naming-convention
__lookupSetter__: ObjectProto__lookupSetter__, hasOwnProperty: ObjectProtoHasOwnProperty, } = Object.prototype;
const { assign: ObjectAssign, create: ObjectCreate$1, defineProperty: ObjectDefineProperty, defineProperties: ObjectDefineProperties, getOwnPropertyDescriptors: ObjectGetOwnPropertyDescriptors, freeze: ObjectFreeze, getOwnPropertyNames: ObjectGetOwnPropertyNames, getOwnPropertySymbols: ObjectGetOwnPropertySymbols, keys: ObjectKeys, seal: ObjectSeal, isSealed: ObjectIsSealed, isFrozen: ObjectIsFrozen, preventExtensions: ObjectPreventExtensions, } = Object;
function ObjectHasOwnProperty(obj, key) {
return obj !== null && obj !== undefined && ReflectApply(ObjectProtoHasOwnProperty, obj, [key]);
}
function ObjectLookupOwnGetter(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return ReflectApply(ObjectProto__lookupGetter__, obj, [key]);
}
function ObjectLookupOwnSetter(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return ReflectApply(ObjectProto__lookupSetter__, obj, [key]);
}
function ObjectLookupOwnValue(obj, key) {
if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
return undefined;
}
return obj[key];
}
const ProxyCtor = Proxy;

@@ -139,3 +121,3 @@ const ProxyRevocable = Proxy.revocable;

function createRevokedProxy(object) {
const revocable = ProxyRevocable(object, ObjectCreate(null));
const revocable = ProxyRevocable(object, ObjectCreate$1(null));
revocable.revoke();

@@ -164,29 +146,75 @@ return revocable.proxy;

const { for: SymbolFor, iterator: SymbolIterator } = Symbol;
const { entries: MapProtoEntries, forEach: MapProtoForEach, set: MapProtoSet } = Map.prototype;
const MapCtor = Map;
const MapEntries = unapply(Map.prototype.entries);
const MapForEach = unapply(Map.prototype.forEach);
const MapGet = unapply(Map.prototype.get);
const MapSet = unapply(Map.prototype.set);
const MapIteratorCreate = unapply(Map.prototype[SymbolIterator]);
function MapConcat(...maps) {
const map = new MapCtor();
for (let i = 0, len = maps.length; i < len; i += 1) {
const m = maps[i];
MapForEach(m, (v, k) => {
MapSet(map, k, v);
});
}
return map;
function MapEntries(map) {
return ReflectApply(MapProtoEntries, map, emptyArray);
}
function MapForEach(map, iteratee) {
return ReflectApply(MapProtoForEach, map, [iteratee]);
}
function MapSet(map, key, value) {
return ReflectApply(MapProtoSet, map, [key, value]);
}
const MathMin = Math.min;
const PromiseThen = unapply(Promise.prototype.then);
const { then: PromiseProtoThen } = Promise.prototype;
function PromiseThen(promise, ...args) {
return ReflectApply(PromiseProtoThen, promise, [args]);
}
const StringCtor = String;
const { charCodeAt: StringProtoCharCodeAt, includes: StringProtoIncludes, match: StringProtoMatch, replace: StringProtoReplace, slice: StringProtoSlice, split: StringProtoSplit, substring: StringProtoSubstring, startsWith: StringProtoStartsWith, toLowerCase: StringProtoToLowerCase, toUpperCase: StringProtoToUpperCase, } = String.prototype;
function StringCharCodeAt(str, index) {
return ReflectApply(StringProtoCharCodeAt, str, [index]);
}
function StringIncludes(str, ...args) {
return ReflectApply(StringProtoIncludes, str, args);
}
function StringMatch(str, regexp) {
return ReflectApply(StringProtoMatch, str, [regexp]);
}
function StringReplace(str, pattern, replacement) {
return ReflectApply(StringProtoReplace, str, [pattern, replacement]);
}
function StringSlice(str, ...args) {
return ReflectApply(StringProtoSlice, str, args);
}
function StringSplit(str, ...args) {
return ReflectApply(StringProtoSplit, str, args);
}
function StringSubstring(str, ...args) {
return ReflectApply(StringProtoSubstring, str, args);
}
function StringStartsWith(str, ...args) {
return ReflectApply(StringProtoStartsWith, str, args);
}
function StringToLowerCase(str) {
return ReflectApply(StringProtoToLowerCase, str, emptyArray);
}
function StringToUpperCase(str) {
return ReflectApply(StringProtoToUpperCase, str, emptyArray);
}
function capitalize(str) {
return str.length ? `${StringToUpperCase(str[0])}${StringSlice(str, 1)}` : '';
}
function toString(value) {
try {
return StringCtor(value);
}
catch (_a) {
return '';
}
}
function toStringIfNotNullOrUndefined(value) {
return value === null || value === undefined ? value : toString(value);
}
const { test: RegExpProtoTest } = RegExp.prototype;
const specialCharRegExp = /[\\^$.*+?()[\]{}|]/g;
const RegExpTest = unapply(RegExp.prototype.test);
function RegExpTest(regexp, content) {
return ReflectApply(RegExpProtoTest, regexp, [content]);
}
function escapeRegExp(string) {
return string.replace(specialCharRegExp, '\\$&');
return StringReplace(string, specialCharRegExp, '\\$&');
}

@@ -209,41 +237,24 @@

const { add: SetProtoAdd, delete: SetProtoDelete, has: SetProtoHas } = Set.prototype;
const SetCtor = Set;
const SetAdd = unapply(Set.prototype.add);
const SetDelete = unapply(Set.prototype.delete);
const SetHas = unapply(Set.prototype.has);
const StringCharAt = unapply(String.prototype.charAt);
const StringCharCodeAt = unapply(String.prototype.charCodeAt);
const StringIndexOf = unapply(String.prototype.indexOf);
const StringMatch = unapply(String.prototype.match);
const StringReplace = unapply(String.prototype.replace);
const StringSlice = unapply(String.prototype.slice);
const StringSplit = unapply(String.prototype.split);
const StringSubstring = unapply(String.prototype.substring);
const StringStartsWith = unapply(String.prototype.startsWith);
const StringToLowerCase = unapply(String.prototype.toLowerCase);
const StringToUpperCase = unapply(String.prototype.toUpperCase);
const StringEndsWith = unapply(String.prototype.endsWith);
const StringTrim = unapply(String.prototype.trim);
const StringIncludes = unapply(String.prototype.includes);
const StringCtor = String;
function toString(value) {
try {
return StringCtor(value);
}
catch (_a) {
return '';
}
function SetAdd(set, value) {
return ReflectApply(SetProtoAdd, set, [value]);
}
function toStringIfNotNullOrUndefined(value) {
return value === null || value === undefined ? value : toString(value);
function SetDelete(set, value) {
return ReflectApply(SetProtoDelete, set, [value]);
}
function capitalize(value) {
return value.length ? `${StringToUpperCase(value[0])}${StringSlice(value, 1)}` : '';
function SetHas(set, value) {
return ReflectApply(SetProtoHas, set, [value]);
}
const { for: SymbolFor, iterator: SymbolIterator } = Symbol;
const { get: WeakMapProtoGet, set: WeakMapProtoSet } = WeakMap.prototype;
const WeakMapCtor = WeakMap;
const WeakMapGet = unapply(WeakMap.prototype.get);
const WeakMapHas = unapply(WeakMap.prototype.has);
const WeakMapSet = unapply(WeakMap.prototype.set);
function WeakMapGet(weakMap, key) {
return ReflectApply(WeakMapProtoGet, weakMap, [key]);
}
function WeakMapSet(weakMap, key, value) {
return ReflectApply(WeakMapProtoSet, weakMap, [key, value]);
}

@@ -264,3 +275,3 @@ const SYMBOL_LIVE_OBJECT = SymbolFor('@@lockerLiveValue');

export { ArrayConcat, ArrayCtor, ArrayFilter, ArrayFrom, ArrayIncludes, ArrayIsArray, ArrayJoin, ArrayProtoPush, ArrayPush, ArrayShallowClone, ArraySlice, ErrorCtor, FunctionBind, JSONParse, JSONStringify, LockerRangeError, LockerSecurityError, MapConcat, MapCtor, MapEntries, MapForEach, MapGet, MapIteratorCreate, MapSet, MathMin, ObjectAssign, ObjectCreate, ObjectDefineProperties, ObjectDefineProperty, ObjectFreeze, ObjectGetOwnPropertyDescriptors, ObjectGetOwnPropertyNames, ObjectGetOwnPropertySymbols, ObjectGetSafeOwnPropertyDescriptors, ObjectHasOwnProperty, ObjectIsFrozen, ObjectIsSealed, ObjectKeys, ObjectLookupOwnGetter, ObjectLookupOwnSetter, ObjectLookupOwnValue, ObjectPreventExtensions, ObjectSeal, PromiseThen, ProxyCtor, ProxyRevocable, RangeErrorCtor, ReflectApply, ReflectConstruct, ReflectDefineProperty, ReflectDeleteProperty, ReflectGet, ReflectGetOwnPropertyDescriptor, ReflectGetPrototypeOf, ReflectGetSafeOwnPropertyDescriptor, ReflectHas, ReflectIsExtensible, ReflectOwnKeys, ReflectPreventExtensions, ReflectSet, ReflectSetPrototypeOf, RegExpTest, SYMBOL_LIVE_OBJECT, SetAdd, SetCtor, SetDelete, SetHas, StringCharAt, StringCharCodeAt, StringEndsWith, StringIncludes, StringIndexOf, StringMatch, StringReplace, StringSlice, StringSplit, StringStartsWith, StringSubstring, StringToLowerCase, StringToUpperCase, StringTrim, SymbolFor, SymbolIterator, TypeErrorCtor, WeakMapCtor, WeakMapGet, WeakMapHas, WeakMapSet, capitalize, createRevokedProxy, createSafeObject, defaults, emptyArray, escapeRegExp, isLiveObject, isObject, isObjectLike, markLiveObject, maskDistortion, sanitizeArguments, shallowCloneOptions, toBoolean, toIgnore, toSafeDescriptor, toSafeDescriptorMap, toString, toStringIfNotNullOrUndefined, unapply, wrap };
/** version: 0.13.1 */
export { ArrayConcat, ArrayCtor, ArrayFilter, ArrayFrom, ArrayIncludes, ArrayIsArray, ArrayJoin, ArrayProtoPush, ArrayPush, ArrayShallowClone, ArraySlice, ErrorCtor, FunctionBind, JSONParse, JSONStringify, LockerRangeError, LockerSecurityError, MapCtor, MapEntries, MapForEach, MapSet, MathMin, ObjectAssign, ObjectCreate$1 as ObjectCreate, ObjectDefineProperties, ObjectDefineProperty, ObjectFreeze, ObjectGetOwnPropertyDescriptors, ObjectGetOwnPropertyNames, ObjectGetOwnPropertySymbols, ObjectHasOwnProperty, ObjectIsFrozen, ObjectIsSealed, ObjectKeys, ObjectLookupOwnGetter, ObjectLookupOwnSetter, ObjectLookupOwnValue, ObjectPreventExtensions, ObjectSeal, PromiseThen, ProxyCtor, ProxyRevocable, RangeErrorCtor, ReflectApply, ReflectConstruct, ReflectDefineProperty, ReflectDeleteProperty, ReflectGet, ReflectGetOwnPropertyDescriptor, ReflectGetPrototypeOf, ReflectHas, ReflectIsExtensible, ReflectOwnKeys, ReflectPreventExtensions, ReflectSet, ReflectSetPrototypeOf, RegExpTest, SYMBOL_LIVE_OBJECT, SetAdd, SetCtor, SetDelete, SetHas, StringCharCodeAt, StringIncludes, StringMatch, StringReplace, StringSlice, StringSplit, StringStartsWith, StringSubstring, StringToLowerCase, StringToUpperCase, SymbolFor, SymbolIterator, TypeErrorCtor, WeakMapCtor, WeakMapGet, WeakMapSet, capitalize, createRevokedProxy, emptyArray, escapeRegExp, isLiveObject, isObject, isObjectLike, markLiveObject, maskDistortion, sanitizeArguments, shallowCloneOptions, toBoolean, toIgnore, toSafeDescriptorMap, toString, toStringIfNotNullOrUndefined, wrap };
/** version: 0.13.2 */
{
"name": "@locker/shared",
"version": "0.13.1",
"version": "0.13.2",
"license": "Salesforce Developer Agreement",

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

},
"gitHead": "e45e156c181f1db0923287cff16a283b5eacff7a"
"gitHead": "8821f240966fb91cce5be32deca204095d133308"
}

@@ -9,10 +9,10 @@ export declare const ArrayCtor: ArrayConstructor;

export declare const ArrayProtoPush: (...items: any[]) => number;
export declare const ArrayConcat: Function;
export declare const ArrayFilter: Function;
export declare const ArrayIncludes: Function;
export declare const ArrayJoin: Function;
export declare const ArrayPush: Function;
export declare const ArraySlice: Function;
export declare const ArrayShallowClone: (arr: Array<any>) => Array<any>;
export declare function ArrayConcat(arr: any[], ...args: any[]): ReturnType<typeof Array.prototype.concat>;
export declare function ArrayFilter(arr: any[], iteratee: Function): ReturnType<typeof Array.prototype.filter>;
export declare function ArrayIncludes(arr: any[], value: any): ReturnType<typeof Array.prototype.includes>;
export declare function ArrayJoin(arr: any[], ...args: string[]): ReturnType<typeof Array.prototype.join>;
export declare function ArrayPush(arr: any[], ...args: any[]): ReturnType<typeof Array.prototype.push>;
export declare function ArrayShallowClone(arr: any[]): any[];
export declare function ArraySlice(arr: any[], ...args: number[]): ReturnType<typeof Array.prototype.slice>;
export declare const emptyArray: [];
//# sourceMappingURL=Array.d.ts.map
export declare function isObject(value: any): boolean;
export declare function isObjectLike(value: any): boolean;
export declare function toSafeDescriptor(descriptor: PropertyDecorator): PropertyDecorator;
export declare function shallowCloneOptions(options: any): any;
export declare function toSafeDescriptorMap(descriptorMap: PropertyDescriptorMap): PropertyDescriptorMap;
export declare function unapply(func: Function): Function;
export declare function shallowCloneOptions(options: any): any;
//# sourceMappingURL=Basic.d.ts.map
export declare const MapCtor: MapConstructor;
export declare const MapEntries: Function;
export declare const MapForEach: Function;
export declare const MapGet: Function;
export declare const MapSet: Function;
export declare const MapIteratorCreate: Function;
export declare function MapConcat(...maps: any): Map<any, any>;
export declare function MapEntries(map: Map<any, any>): ReturnType<typeof Map.prototype.entries>;
export declare function MapForEach(map: Map<any, any>, iteratee: Function): ReturnType<typeof Map.prototype.forEach>;
export declare function MapSet(map: Map<any, any>, key: any, value: any): ReturnType<typeof Map.prototype.set>;
//# sourceMappingURL=Map.d.ts.map

@@ -19,11 +19,6 @@ export declare const ObjectAssign: {

}, ObjectSeal: <T>(o: T) => T, ObjectIsSealed: (o: any) => boolean, ObjectIsFrozen: (o: any) => boolean, ObjectPreventExtensions: <T>(o: T) => T;
export declare function ObjectGetSafeOwnPropertyDescriptors(target: object): PropertyDescriptorMap;
export declare function ObjectHasOwnProperty(obj: object | undefined, key: PropertyKey): boolean;
export declare function ObjectLookupOwnGetter(obj: object, key: PropertyKey): Function | undefined;
export declare function ObjectLookupOwnSetter(obj: object, key: PropertyKey): Function | undefined;
export declare function ObjectLookupOwnValue(obj: object, key: PropertyKey): Function | undefined;
export declare function createSafeObject<T>(target: T): {
[K in keyof T]: T[K];
};
export declare function defaults(target: any, source: any): any;
export declare function ObjectLookupOwnValue(obj: any, key: PropertyKey): Function | undefined;
//# sourceMappingURL=Object.d.ts.map

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

export declare const PromiseThen: Function;
export declare function PromiseThen(promise: Promise<any>, ...args: any[]): Promise<any>;
//# sourceMappingURL=Promise.d.ts.map
export declare const ReflectApply: typeof Reflect.apply, ReflectConstruct: typeof Reflect.construct, ReflectDeleteProperty: typeof Reflect.deleteProperty, ReflectHas: typeof Reflect.has, ReflectGet: typeof Reflect.get, ReflectGetPrototypeOf: typeof Reflect.getPrototypeOf, ReflectSet: typeof Reflect.set, ReflectSetPrototypeOf: typeof Reflect.setPrototypeOf, ReflectDefineProperty: typeof Reflect.defineProperty, ReflectIsExtensible: typeof Reflect.isExtensible, ReflectGetOwnPropertyDescriptor: typeof Reflect.getOwnPropertyDescriptor, ReflectOwnKeys: typeof Reflect.ownKeys, ReflectPreventExtensions: typeof Reflect.preventExtensions;
export declare function ReflectGetSafeOwnPropertyDescriptor(target: object, key: string): PropertyDecorator | undefined;
//# sourceMappingURL=Reflect.d.ts.map

@@ -1,3 +0,3 @@

export declare const RegExpTest: Function;
export declare function RegExpTest(regexp: RegExp, content: any): boolean;
export declare function escapeRegExp(string: string): string;
//# sourceMappingURL=RegExp.d.ts.map
export declare const SetCtor: SetConstructor;
export declare const SetAdd: Function;
export declare const SetDelete: Function;
export declare const SetHas: Function;
export declare function SetAdd(set: Set<any>, value: any): Set<any>;
export declare function SetDelete(set: Set<any>, value: any): boolean;
export declare function SetHas(set: Set<any>, value: any): boolean;
//# sourceMappingURL=Set.d.ts.map

@@ -1,18 +0,14 @@

export declare const StringCharAt: Function;
export declare const StringCharCodeAt: Function;
export declare const StringIndexOf: Function;
export declare const StringMatch: Function;
export declare const StringReplace: Function;
export declare const StringSlice: Function;
export declare const StringSplit: Function;
export declare const StringSubstring: Function;
export declare const StringStartsWith: Function;
export declare const StringToLowerCase: Function;
export declare const StringToUpperCase: Function;
export declare const StringEndsWith: Function;
export declare const StringTrim: Function;
export declare const StringIncludes: Function;
export declare function StringCharCodeAt(str: string, index: number): ReturnType<typeof String.prototype.charCodeAt>;
export declare function StringIncludes(str: string, ...args: any[]): ReturnType<typeof String.prototype.includes>;
export declare function StringMatch(str: string, regexp: RegExp): ReturnType<typeof String.prototype.match>;
export declare function StringReplace(str: string, pattern: RegExp | string, replacement: Function | string): ReturnType<typeof String.prototype.replace>;
export declare function StringSlice(str: string, ...args: any[]): ReturnType<typeof String.prototype.slice>;
export declare function StringSplit(str: string, ...args: any[]): ReturnType<typeof String.prototype.split>;
export declare function StringSubstring(str: string, ...args: any[]): ReturnType<typeof String.prototype.substring>;
export declare function StringStartsWith(str: string, ...args: any[]): ReturnType<typeof String.prototype.startsWith>;
export declare function StringToLowerCase(str: string): ReturnType<typeof String.prototype.toLowerCase>;
export declare function StringToUpperCase(str: string): ReturnType<typeof String.prototype.toUpperCase>;
export declare function capitalize(str: string): string;
export declare function toString(value: any): string;
export declare function toStringIfNotNullOrUndefined(value: any): string | null | undefined;
export declare function capitalize(value: string): string;
//# sourceMappingURL=String.d.ts.map
export declare const WeakMapCtor: WeakMapConstructor;
export declare const WeakMapGet: Function;
export declare const WeakMapHas: Function;
export declare const WeakMapSet: Function;
export declare function WeakMapGet(weakMap: WeakMap<object, object>, key: object): ReturnType<typeof WeakMap.prototype.get>;
export declare function WeakMapSet(weakMap: WeakMap<object, object>, key: object, value: object): ReturnType<typeof WeakMap.prototype.set>;
//# sourceMappingURL=WeakMap.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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