Comparing version 0.1.2 to 0.1.3
@@ -1,1 +0,1 @@ | ||
export declare function shallowCopy<T>(source: T, callback?: (target: T) => T): T; | ||
export declare function shallowCopy<T>(source: T, callback?: (target: T) => T | void): T; |
@@ -7,5 +7,6 @@ function shallowCopy(source, callback) { | ||
target[property] = source[property]; | ||
return callback(target); | ||
callback(target); | ||
return target; | ||
} | ||
exports.shallowCopy = shallowCopy; | ||
; |
@@ -1,7 +0,9 @@ | ||
export function shallowCopy<T>(source: T, callback: (target: T) => T = (t: T) => { return t; }): T { | ||
let target = {}; | ||
export function shallowCopy<T>(source: T, callback: (target: T) => T | void = (t: T) => { return t; }): T { | ||
let target = <T>{}; | ||
for (var property in source) | ||
if (source.hasOwnProperty(property)) | ||
target[property] = source[property]; | ||
return callback(<T>target); | ||
callback(target); | ||
return target; | ||
}; | ||
{ | ||
"name": "fun-model", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "fun-model is pure functional implementation of FLUX architecture.", | ||
@@ -5,0 +5,0 @@ "main": "dist/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
23083
415