@zag-js/utils 1.7.0 → 1.8.0

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
@@ -108,7 +108,7 @@ declare function warn(m: string): void;
108
108
  declare function warn(c: boolean, m: string): void;
109
109
  declare function invariant(m: string): void;
110
110
  declare function invariant(c: boolean, m: string): void;
111
- declare function ensure<T>(c: T | null | undefined, m: string): asserts c is T;
111
+ declare function ensure<T>(c: T | null | undefined, m: () => string): asserts c is T;
112
112
  type RequiredBy<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
113
113
  declare function ensureProps<T, K extends keyof T>(props: T, keys: K[], scope?: string): asserts props is T & RequiredBy<T, K>;
114
114
 
package/dist/index.d.ts CHANGED
@@ -108,7 +108,7 @@ declare function warn(m: string): void;
108
108
  declare function warn(c: boolean, m: string): void;
109
109
  declare function invariant(m: string): void;
110
110
  declare function invariant(c: boolean, m: string): void;
111
- declare function ensure<T>(c: T | null | undefined, m: string): asserts c is T;
111
+ declare function ensure<T>(c: T | null | undefined, m: () => string): asserts c is T;
112
112
  type RequiredBy<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
113
113
  declare function ensureProps<T, K extends keyof T>(props: T, keys: K[], scope?: string): asserts props is T & RequiredBy<T, K>;
114
114
 
package/dist/index.js CHANGED
@@ -392,7 +392,7 @@ function invariant(...a) {
392
392
  }
393
393
  }
394
394
  function ensure(c, m) {
395
- if (c == null) throw new Error(m);
395
+ if (c == null) throw new Error(m());
396
396
  }
397
397
  function ensureProps(props, keys, scope) {
398
398
  let missingKeys = [];
package/dist/index.mjs CHANGED
@@ -390,7 +390,7 @@ function invariant(...a) {
390
390
  }
391
391
  }
392
392
  function ensure(c, m) {
393
- if (c == null) throw new Error(m);
393
+ if (c == null) throw new Error(m());
394
394
  }
395
395
  function ensureProps(props, keys, scope) {
396
396
  let missingKeys = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/utils",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "js",