Comparing version 1.4.0 to 1.4.1
@@ -14,4 +14,4 @@ export interface MapFn { | ||
map(value: any, key?: string | number): any; | ||
private mapArray(arr, key); | ||
private mapObject(obj, key); | ||
private mapArray(arr); | ||
private mapObject(obj); | ||
} |
@@ -11,7 +11,7 @@ "use strict"; | ||
DeepMap.prototype.map = function (value, key) { | ||
return lodash_1.isArray(value) ? this.mapArray(value, key) : | ||
lodash_1.isObject(value) ? this.mapObject(value, key) : | ||
return lodash_1.isArray(value) ? this.mapArray(value) : | ||
lodash_1.isObject(value) ? this.mapObject(value) : | ||
this.mapFn.call(this.opts.thisArg, value, key); | ||
}; | ||
DeepMap.prototype.mapArray = function (arr, key) { | ||
DeepMap.prototype.mapArray = function (arr) { | ||
if (this.cache.has(arr)) { | ||
@@ -28,3 +28,3 @@ return this.cache.get(arr); | ||
}; | ||
DeepMap.prototype.mapObject = function (obj, key) { | ||
DeepMap.prototype.mapObject = function (obj) { | ||
if (this.cache.has(obj)) { | ||
@@ -35,5 +35,5 @@ return this.cache.get(obj); | ||
this.cache.set(obj, result); | ||
for (var key_1 in obj) { | ||
if (obj.hasOwnProperty(key_1)) { | ||
result[key_1] = this.map(obj[key_1], key_1); | ||
for (var key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
result[key] = this.map(obj[key], key); | ||
} | ||
@@ -40,0 +40,0 @@ } |
{ | ||
"name": "deep-map", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Transforms nested values of complex objects", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
14098