@stndrds/schema 1.0.0-alpha.279 → 1.0.0-alpha.281

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.
Files changed (40) hide show
  1. package/dist/all-BVp3k9Hi.d.ts +471 -0
  2. package/dist/all-CnIU2anT.d.mts +471 -0
  3. package/dist/{chunk-PQEOIDXD.mjs → chunk-A5PPZ2FM.mjs} +1 -1
  4. package/dist/{chunk-ZEPGMHCK.js → chunk-E47WAI5K.js} +4 -4
  5. package/dist/{chunk-ZBWTAKZO.js → chunk-HWZRSXFB.js} +6 -1
  6. package/dist/{chunk-DEHBEFGO.js → chunk-LRFLSFIA.js} +3 -3
  7. package/dist/{chunk-QUZ3PN36.mjs → chunk-MLTXSBOB.mjs} +1 -1
  8. package/dist/{chunk-5PLJHYSL.mjs → chunk-ORPCS24B.mjs} +5 -11
  9. package/dist/{chunk-FRCDMQER.js → chunk-OYHBQMC7.js} +34 -0
  10. package/dist/{chunk-V2WJFUZW.mjs → chunk-SYQDFZ74.mjs} +6 -1
  11. package/dist/{chunk-QMAVKX3Y.js → chunk-TU6ECJFZ.js} +37 -43
  12. package/dist/chunk-XCLVXM7F.mjs +74 -0
  13. package/dist/exceptions.d.mts +5 -0
  14. package/dist/exceptions.d.ts +5 -0
  15. package/dist/exceptions.js +39 -39
  16. package/dist/exceptions.mjs +1 -1
  17. package/dist/{index-C3P5Dnwt.d.mts → index-DWoqObyG.d.mts} +13 -22
  18. package/dist/{index-SpFpkWVC.d.ts → index-TMlrIKAY.d.ts} +13 -22
  19. package/dist/index.d.mts +259 -94
  20. package/dist/index.d.ts +259 -94
  21. package/dist/index.js +1178 -317
  22. package/dist/index.mjs +970 -124
  23. package/dist/utils.d.mts +16 -1
  24. package/dist/utils.d.ts +16 -1
  25. package/dist/utils.js +11 -6
  26. package/dist/utils.mjs +2 -1
  27. package/dist/validation/all.d.mts +2 -2
  28. package/dist/validation/all.d.ts +2 -2
  29. package/dist/validation/all.js +29 -29
  30. package/dist/validation/all.mjs +4 -4
  31. package/dist/validation/config/index.d.mts +1 -1
  32. package/dist/validation/config/index.d.ts +1 -1
  33. package/dist/validation/config/index.js +11 -11
  34. package/dist/validation/config/index.mjs +2 -2
  35. package/dist/validation/object/index.js +14 -14
  36. package/dist/validation/object/index.mjs +2 -2
  37. package/package.json +2 -2
  38. package/dist/all-Bk8cRKsu.d.mts +0 -482
  39. package/dist/all-C_tC90ZM.d.ts +0 -482
  40. package/dist/chunk-QY6QFRRV.mjs +0 -41
@@ -1,41 +0,0 @@
1
- // src/utils.ts
2
- function asTenantId(id) {
3
- return id;
4
- }
5
- function asUserId(id) {
6
- return id;
7
- }
8
- function generateId() {
9
- if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
10
- return crypto.randomUUID();
11
- }
12
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
13
- const r = Math.random() * 16 | 0;
14
- const v = c === "x" ? r : r & 3 | 8;
15
- return v.toString(16);
16
- });
17
- }
18
- function indexBy(items, keyFn) {
19
- return new Map(items.map((item) => [keyFn(item), item]));
20
- }
21
- function deepEqual(a, b) {
22
- if (a === b) return true;
23
- if (a == null || b == null) return false;
24
- if (typeof a !== typeof b) return false;
25
- if (Array.isArray(a)) {
26
- if (!Array.isArray(b)) return false;
27
- if (a.length !== b.length) return false;
28
- return a.every((item, index) => deepEqual(item, b[index]));
29
- }
30
- if (typeof a === "object" && typeof b === "object") {
31
- const aObj = a;
32
- const bObj = b;
33
- const aKeys = Object.keys(aObj);
34
- const bKeys = Object.keys(bObj);
35
- if (aKeys.length !== bKeys.length) return false;
36
- return aKeys.every((key) => key in bObj && deepEqual(aObj[key], bObj[key]));
37
- }
38
- return false;
39
- }
40
-
41
- export { asTenantId, asUserId, deepEqual, generateId, indexBy };