@zag-js/utils
Advanced tools
Comparing version 0.0.0-dev-20221103102301 to 0.0.0-dev-20221105065843
@@ -36,2 +36,4 @@ declare function toArray<T>(v: T | T[] | undefined | null): T[]; | ||
declare function compact<T extends Record<string, unknown>>(obj: T): T; | ||
declare function warn(m: string): void; | ||
@@ -42,2 +44,2 @@ declare function warn(c: boolean, m: string): void; | ||
export { IndexOptions, add, callAll, cast, chunk, clear, first, fromLength, has, hasProp, invariant, isArray, isBoolean, isDev, isEmpty, isFunction, isNumber, isObject, isString, last, next, nextIndex, noop, prev, prevIndex, remove, removeAt, runIfFn, toArray, uuid, warn }; | ||
export { IndexOptions, add, callAll, cast, chunk, clear, compact, first, fromLength, has, hasProp, invariant, isArray, isBoolean, isDev, isEmpty, isFunction, isNumber, isObject, isString, last, next, nextIndex, noop, prev, prevIndex, remove, removeAt, runIfFn, toArray, uuid, warn }; |
@@ -28,2 +28,3 @@ "use strict"; | ||
clear: () => clear, | ||
compact: () => compact, | ||
first: () => first, | ||
@@ -146,2 +147,9 @@ fromLength: () => fromLength, | ||
// src/object.ts | ||
function compact(obj) { | ||
return Object.fromEntries( | ||
Object.entries(obj).filter(([, value]) => value !== void 0).map(([key, value]) => [key, isObject(value) ? compact(value) : value]) | ||
); | ||
} | ||
// src/warning.ts | ||
@@ -169,2 +177,3 @@ function warn(...a) { | ||
clear, | ||
compact, | ||
first, | ||
@@ -171,0 +180,0 @@ fromLength, |
{ | ||
"name": "@zag-js/utils", | ||
"version": "0.0.0-dev-20221103102301", | ||
"version": "0.0.0-dev-20221105065843", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/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
12762
373