@zag-js/utils 1.26.5 → 1.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -95,7 +95,7 @@ declare const toPx: (v: number | string | undefined) => string | undefined;
95
95
  declare function compact<T extends Record<string, unknown> | undefined>(obj: T): T;
96
96
  declare const json: (v: any) => any;
97
97
  declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
98
- type Dict = Record<string, any>;
98
+ type Dict = Record<string | symbol, any>;
99
99
  declare function splitProps<T extends Dict>(props: T, keys: (keyof T)[]): Dict[];
100
100
  declare const createSplitProps: <T extends Dict>(keys: (keyof T)[]) => <Props extends T>(props: Props) => [T, Omit<Props, keyof T>];
101
101
  declare function omit<T extends Record<string, any>>(obj: T, keys: string[]): Omit<T, string | number>;
package/dist/index.d.ts CHANGED
@@ -95,7 +95,7 @@ declare const toPx: (v: number | string | undefined) => string | undefined;
95
95
  declare function compact<T extends Record<string, unknown> | undefined>(obj: T): T;
96
96
  declare const json: (v: any) => any;
97
97
  declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
98
- type Dict = Record<string, any>;
98
+ type Dict = Record<string | symbol, any>;
99
99
  declare function splitProps<T extends Dict>(props: T, keys: (keyof T)[]): Dict[];
100
100
  declare const createSplitProps: <T extends Dict>(keys: (keyof T)[]) => <Props extends T>(props: Props) => [T, Omit<Props, keyof T>];
101
101
  declare function omit<T extends Record<string, any>>(obj: T, keys: string[]): Omit<T, string | number>;
package/dist/index.js CHANGED
@@ -362,7 +362,8 @@ function splitProps(props, keys) {
362
362
  const rest = {};
363
363
  const result = {};
364
364
  const keySet = new Set(keys);
365
- for (const key in props) {
365
+ const ownKeys = Reflect.ownKeys(props);
366
+ for (const key of ownKeys) {
366
367
  if (keySet.has(key)) {
367
368
  result[key] = props[key];
368
369
  } else {
package/dist/index.mjs CHANGED
@@ -360,7 +360,8 @@ function splitProps(props, keys) {
360
360
  const rest = {};
361
361
  const result = {};
362
362
  const keySet = new Set(keys);
363
- for (const key in props) {
363
+ const ownKeys = Reflect.ownKeys(props);
364
+ for (const key of ownKeys) {
364
365
  if (keySet.has(key)) {
365
366
  result[key] = props[key];
366
367
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/utils",
3
- "version": "1.26.5",
3
+ "version": "1.27.1",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "js",