@peersyst/react-utils
Advanced tools
Comparing version 2.2.2 to 2.2.3
import { DeepPick, NestedKeys } from "@peersyst/react-types"; | ||
export default function <T extends object, K extends NestedKeys<T>>(obj: T, key: K): DeepPick<T, K> | undefined; | ||
export default function <T extends object, K extends NestedKeys<T>>(obj: T, key: K): DeepPick<T, K>; |
@@ -1,4 +0,6 @@ | ||
import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
import _toArray from "@babel/runtime/helpers/esm/toArray"; | ||
export default function (obj, key) { | ||
// @ts-ignore Not excessively deep (max 10 levels) | ||
export default function (obj, key | ||
// @ts-ignore Not excessively deep (max 10 levels) | ||
) { | ||
var _key$split = key.split("."), | ||
@@ -8,9 +10,7 @@ _key$split2 = _toArray(_key$split), | ||
restKeys = _key$split2.slice(1); | ||
var value = obj[firstKey]; | ||
for (var _key in restKeys) { | ||
var _value; | ||
if (_typeof(value) !== "object" || value === null) return undefined; | ||
value = (_value = value) == null ? void 0 : _value[_key]; | ||
} | ||
return value; | ||
// @ts-ignore | ||
return restKeys.reduce(function (prev, curr) { | ||
return prev[curr]; | ||
}, obj[firstKey]); | ||
} |
@@ -1,4 +0,6 @@ | ||
import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
import _toArray from "@babel/runtime/helpers/esm/toArray"; | ||
export default function (obj, key) { | ||
// @ts-ignore Not excessively deep (max 10 levels) | ||
export default function (obj, key | ||
// @ts-ignore Not excessively deep (max 10 levels) | ||
) { | ||
var _key$split = key.split("."), | ||
@@ -8,9 +10,7 @@ _key$split2 = _toArray(_key$split), | ||
restKeys = _key$split2.slice(1); | ||
var value = obj[firstKey]; | ||
for (var _key in restKeys) { | ||
var _value; | ||
if (_typeof(value) !== "object" || value === null) return undefined; | ||
value = (_value = value) == null ? void 0 : _value[_key]; | ||
} | ||
return value; | ||
// @ts-ignore | ||
return restKeys.reduce(function (prev, curr) { | ||
return prev[curr]; | ||
}, obj[firstKey]); | ||
} |
@@ -1,4 +0,6 @@ | ||
import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
import _toArray from "@babel/runtime/helpers/esm/toArray"; | ||
export default function (obj, key) { | ||
// @ts-ignore Not excessively deep (max 10 levels) | ||
export default function (obj, key | ||
// @ts-ignore Not excessively deep (max 10 levels) | ||
) { | ||
var _key$split = key.split("."), | ||
@@ -8,9 +10,7 @@ _key$split2 = _toArray(_key$split), | ||
restKeys = _key$split2.slice(1); | ||
var value = obj[firstKey]; | ||
for (var _key in restKeys) { | ||
var _value; | ||
if (_typeof(value) !== "object" || value === null) return undefined; | ||
value = (_value = value) == null ? void 0 : _value[_key]; | ||
} | ||
return value; | ||
// @ts-ignore | ||
return restKeys.reduce(function (prev, curr) { | ||
return prev[curr]; | ||
}, obj[firstKey]); | ||
} |
@@ -8,5 +8,7 @@ "use strict"; | ||
exports["default"] = _default; | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray")); | ||
function _default(obj, key) { | ||
// @ts-ignore Not excessively deep (max 10 levels) | ||
function _default(obj, key | ||
// @ts-ignore Not excessively deep (max 10 levels) | ||
) { | ||
var _key$split = key.split("."), | ||
@@ -16,9 +18,7 @@ _key$split2 = (0, _toArray2["default"])(_key$split), | ||
restKeys = _key$split2.slice(1); | ||
var value = obj[firstKey]; | ||
for (var _key in restKeys) { | ||
var _value; | ||
if ((0, _typeof2["default"])(value) !== "object" || value === null) return undefined; | ||
value = (_value = value) == null ? void 0 : _value[_key]; | ||
} | ||
return value; | ||
// @ts-ignore | ||
return restKeys.reduce(function (prev, curr) { | ||
return prev[curr]; | ||
}, obj[firstKey]); | ||
} |
{ | ||
"name": "@peersyst/react-utils", | ||
"author": "Peersyst", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"license": "MIT", | ||
@@ -21,3 +21,3 @@ "main": "./node/index.js", | ||
"@babel/runtime": "^7.16.7", | ||
"@peersyst/react-types": "^1.5.0", | ||
"@peersyst/react-types": "^1.5.1", | ||
"validate-color": "^2.2.1" | ||
@@ -24,0 +24,0 @@ }, |
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
175696
3662
Updated@peersyst/react-types@^1.5.1