@appolo/utils
Advanced tools
Comparing version 8.0.21 to 8.0.22
@@ -147,2 +147,11 @@ "use strict"; | ||
} | ||
static has(obj, key) { | ||
if (!obj || !key) { | ||
return false; | ||
} | ||
let keyParts = key.split('.'); | ||
return !!obj && (keyParts.length > 1 | ||
? Objects.has(obj[key.split('.')[0]], keyParts.slice(1).join('.')) | ||
: Object.hasOwnProperty.call(obj, key)); | ||
} | ||
static mapObject(obj, iteratee) { | ||
@@ -149,0 +158,0 @@ const memo = []; |
@@ -66,3 +66,3 @@ import {Arrays} from "./arrays"; | ||
if (Objects.isPlain(value)) { | ||
obj[key] = Objects.defaultsDeep({},source, value) | ||
obj[key] = Objects.defaultsDeep({}, source, value) | ||
} else if (!(key in obj) || (source === undefined && value != undefined)) { | ||
@@ -193,2 +193,16 @@ obj[key] = value | ||
public static has(obj: any, key: string): boolean { | ||
if (!obj || !key) { | ||
return false; | ||
} | ||
let keyParts = key.split('.'); | ||
return !!obj && ( | ||
keyParts.length > 1 | ||
? Objects.has(obj[key.split('.')[0]], keyParts.slice(1).join('.')) | ||
: Object.hasOwnProperty.call(obj, key) | ||
); | ||
} | ||
public static mapObject<T>(obj: any, iteratee: (value: any, key: string) => T): T[] { | ||
@@ -195,0 +209,0 @@ const memo: T[] = []; |
@@ -20,3 +20,3 @@ { | ||
"main": "./index.js", | ||
"version": "8.0.21", | ||
"version": "8.0.22", | ||
"license": "MIT", | ||
@@ -23,0 +23,0 @@ "repository": { |
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
193753
3448