@jala-banyu/shared-utils
Advanced tools
Comparing version 1.1.0 to 1.1.1
export { Dict, __DEV__, __TEST__, dataAttr, isArray, isEmpty, isEmptyArray, isEmptyObject, isFunction, isNumeric, isObject } from './assertion.js'; | ||
export { clsx } from './clsx.js'; | ||
export { MergeObject, arrayToObject, cleanObject, cleanObjectKeys, compact, copyObject, getProp, omitObject, renameProp } from './object.js'; | ||
export { MergeObject, arrayToObject, cleanObject, cleanObjectKeys, compact, copyObject, getKeyValue, getProp, omitObject, renameProp } from './object.js'; | ||
export { safeAriaLabel, safeText } from './text.js'; | ||
@@ -10,1 +10,2 @@ export { getMargin } from './dimensions.js'; | ||
export { Timer } from './types.js'; | ||
import '@react-types/shared'; |
@@ -37,2 +37,3 @@ "use strict"; | ||
extractProperty: () => extractProperty, | ||
getKeyValue: () => getKeyValue, | ||
getMargin: () => getMargin, | ||
@@ -175,2 +176,9 @@ getProp: () => getProp, | ||
}; | ||
var getKeyValue = (obj, key) => { | ||
if (!isObject(obj)) | ||
return obj; | ||
if (obj instanceof Array) | ||
return [...obj]; | ||
return obj[key]; | ||
}; | ||
var getProp = (obj, path, fallback, index) => { | ||
@@ -303,2 +311,3 @@ const key = typeof path === "string" ? path.split(".") : [path]; | ||
extractProperty, | ||
getKeyValue, | ||
getMargin, | ||
@@ -305,0 +314,0 @@ getProp, |
@@ -0,1 +1,3 @@ | ||
import { Key } from '@react-types/shared'; | ||
interface MergeObject { | ||
@@ -13,2 +15,3 @@ [key: string]: any; | ||
declare const cleanObjectKeys: (obj: any, keys?: string[]) => any; | ||
declare const getKeyValue: (obj: any, key: Key) => any; | ||
/** | ||
@@ -30,2 +33,2 @@ * Get value from a deeply nested object using a string path. | ||
export { type MergeObject, arrayToObject, cleanObject, cleanObjectKeys, compact, copyObject, getProp, omitObject, renameProp }; | ||
export { type MergeObject, arrayToObject, cleanObject, cleanObjectKeys, compact, copyObject, getKeyValue, getProp, omitObject, renameProp }; |
@@ -28,2 +28,3 @@ "use strict"; | ||
copyObject: () => copyObject, | ||
getKeyValue: () => getKeyValue, | ||
getProp: () => getProp, | ||
@@ -93,2 +94,9 @@ omitObject: () => omitObject, | ||
}; | ||
var getKeyValue = (obj, key) => { | ||
if (!isObject(obj)) | ||
return obj; | ||
if (obj instanceof Array) | ||
return [...obj]; | ||
return obj[key]; | ||
}; | ||
var getProp = (obj, path, fallback, index) => { | ||
@@ -125,2 +133,3 @@ const key = typeof path === "string" ? path.split(".") : [path]; | ||
copyObject, | ||
getKeyValue, | ||
getProp, | ||
@@ -127,0 +136,0 @@ omitObject, |
{ | ||
"name": "@jala-banyu/shared-utils", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
44684
1395