Comparing version 0.1.3 to 0.1.4
import { AnyFunction, WrapperObj } from './types'; | ||
export declare function wrap(obj: any, name: string, userWrapper: AnyFunction): WrapperObj; | ||
export declare function massWrap(objs: any | any[], names: string[], userWrapper: AnyFunction, getUnwrap?: boolean): WrapperObj[]; | ||
export declare function massWrap(objs: any | any[], names: string[], userWrapper: AnyFunction): WrapperObj[]; | ||
export declare function unwrap(obj: any, name: string): void; | ||
export declare function massUnwrap(objs: any | any[], names: string[]): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const WRAPPED = '__mpWrapped'; | ||
const WRAPPED_SHIMMER = '__wrapped'; | ||
const storeWrapper = new WeakMap(); | ||
@@ -30,3 +29,3 @@ const logger = console.error.bind(console); | ||
exports.wrap = wrap; | ||
function massWrap(objs, names, userWrapper, getUnwrap) { | ||
function massWrap(objs, names, userWrapper) { | ||
const results = []; | ||
@@ -155,6 +154,4 @@ if (!objs) { | ||
} | ||
// compatible with shimmer for any checks etc. | ||
// just for testing purposes, later to be removed | ||
defineProperty(wrapper, WRAPPED, true); | ||
defineProperty(wrapper, WRAPPED_SHIMMER, true); | ||
extendObject(original, next); | ||
defineProperty(obj, name, wrapper); | ||
@@ -190,2 +187,7 @@ storeWrapper.set(wrapper, { | ||
} | ||
function extendObject(source, destination) { | ||
Object.keys(source).forEach((key) => { | ||
destination[key] = source[key]; | ||
}); | ||
} | ||
//# sourceMappingURL=wrapper.js.map |
{ | ||
"name": "mpwrapper", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Monkey Patch Wrapper that support multiple wrapping and unwrapping", | ||
@@ -5,0 +5,0 @@ "main": "build/src/index.js", |
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
213
22367