@absoluteui/helpers 0.0.0-stage → 0.13.2

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 (221) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +5 -0
  3. package/README.md +47 -2
  4. package/SECURITY.md +102 -0
  5. package/dist/array/compare.d.ts +8 -0
  6. package/dist/array/compare.js +2 -0
  7. package/dist/array/index.d.ts +328 -0
  8. package/dist/array/index.js +2 -0
  9. package/dist/array/tree.d.ts +48 -0
  10. package/dist/array/tree.js +2 -0
  11. package/dist/async/batch.d.ts +103 -0
  12. package/dist/async/batch.js +2 -0
  13. package/dist/async/concurrency.d.ts +92 -0
  14. package/dist/async/concurrency.js +2 -0
  15. package/dist/async/control.d.ts +77 -0
  16. package/dist/async/control.js +2 -0
  17. package/dist/async/index.d.ts +8 -0
  18. package/dist/async/index.js +2 -0
  19. package/dist/async/signal.d.ts +95 -0
  20. package/dist/async/signal.js +2 -0
  21. package/dist/boolean/index.d.ts +83 -0
  22. package/dist/boolean/index.js +2 -0
  23. package/dist/business-calendar/days.d.ts +397 -0
  24. package/dist/business-calendar/days.js +2 -0
  25. package/dist/business-calendar/describe.d.ts +45 -0
  26. package/dist/business-calendar/describe.js +2 -0
  27. package/dist/business-calendar/engine.d.ts +305 -0
  28. package/dist/business-calendar/engine.js +2 -0
  29. package/dist/business-calendar/hours.d.ts +96 -0
  30. package/dist/business-calendar/hours.js +2 -0
  31. package/dist/business-calendar/index.d.ts +29 -0
  32. package/dist/business-calendar/index.js +2 -0
  33. package/dist/business-calendar/internal.d.ts +44 -0
  34. package/dist/business-calendar/internal.js +2 -0
  35. package/dist/business-calendar/rules.d.ts +260 -0
  36. package/dist/business-calendar/rules.js +2 -0
  37. package/dist/color/index.d.ts +200 -0
  38. package/dist/color/index.js +2 -0
  39. package/dist/color/named.d.ts +4 -0
  40. package/dist/color/named.js +2 -0
  41. package/dist/compare/index.d.ts +186 -0
  42. package/dist/compare/index.js +2 -0
  43. package/dist/convert/index.d.ts +152 -0
  44. package/dist/convert/index.js +2 -0
  45. package/dist/csv/index.d.ts +6 -0
  46. package/dist/csv/index.js +2 -0
  47. package/dist/csv/parse.d.ts +85 -0
  48. package/dist/csv/parse.js +12 -0
  49. package/dist/csv/stringify.d.ts +48 -0
  50. package/dist/csv/stringify.js +5 -0
  51. package/dist/date/calendar.d.ts +339 -0
  52. package/dist/date/calendar.js +2 -0
  53. package/dist/date/format.d.ts +66 -0
  54. package/dist/date/format.js +2 -0
  55. package/dist/date/index.d.ts +26 -0
  56. package/dist/date/index.js +2 -0
  57. package/dist/date/intervals.d.ts +110 -0
  58. package/dist/date/intervals.js +2 -0
  59. package/dist/date/intl-cache.d.ts +10 -0
  60. package/dist/date/intl-cache.js +2 -0
  61. package/dist/date/locale.d.ts +58 -0
  62. package/dist/date/locale.js +2 -0
  63. package/dist/date/plain-date.d.ts +105 -0
  64. package/dist/date/plain-date.js +2 -0
  65. package/dist/date/plain-time.d.ts +121 -0
  66. package/dist/date/plain-time.js +2 -0
  67. package/dist/date/zone.d.ts +121 -0
  68. package/dist/date/zone.js +2 -0
  69. package/dist/decimal/index.d.ts +149 -0
  70. package/dist/decimal/index.js +2 -0
  71. package/dist/ds/avl.d.ts +50 -0
  72. package/dist/ds/avl.js +2 -0
  73. package/dist/ds/bitset.d.ts +46 -0
  74. package/dist/ds/bitset.js +2 -0
  75. package/dist/ds/bloom.d.ts +41 -0
  76. package/dist/ds/bloom.js +2 -0
  77. package/dist/ds/caches.d.ts +141 -0
  78. package/dist/ds/caches.js +2 -0
  79. package/dist/ds/disjoint-set.d.ts +38 -0
  80. package/dist/ds/disjoint-set.js +2 -0
  81. package/dist/ds/emitter.d.ts +53 -0
  82. package/dist/ds/emitter.js +2 -0
  83. package/dist/ds/graph.d.ts +84 -0
  84. package/dist/ds/graph.js +2 -0
  85. package/dist/ds/heap.d.ts +49 -0
  86. package/dist/ds/heap.js +2 -0
  87. package/dist/ds/index.d.ts +20 -0
  88. package/dist/ds/index.js +2 -0
  89. package/dist/ds/internal.d.ts +19 -0
  90. package/dist/ds/internal.js +2 -0
  91. package/dist/ds/interval-tree.d.ts +49 -0
  92. package/dist/ds/interval-tree.js +2 -0
  93. package/dist/ds/linked-list.d.ts +54 -0
  94. package/dist/ds/linked-list.js +2 -0
  95. package/dist/ds/maps.d.ts +89 -0
  96. package/dist/ds/maps.js +2 -0
  97. package/dist/ds/ring.d.ts +99 -0
  98. package/dist/ds/ring.js +2 -0
  99. package/dist/ds/sorted.d.ts +104 -0
  100. package/dist/ds/sorted.js +2 -0
  101. package/dist/ds/stack.d.ts +28 -0
  102. package/dist/ds/stack.js +2 -0
  103. package/dist/ds/trie.d.ts +84 -0
  104. package/dist/ds/trie.js +2 -0
  105. package/dist/duration/index.d.ts +146 -0
  106. package/dist/duration/index.js +2 -0
  107. package/dist/encoding/index.d.ts +144 -0
  108. package/dist/encoding/index.js +2 -0
  109. package/dist/error/index.d.ts +316 -0
  110. package/dist/error/index.js +2 -0
  111. package/dist/fn/index.d.ts +129 -0
  112. package/dist/fn/index.js +2 -0
  113. package/dist/fn/memo.d.ts +46 -0
  114. package/dist/fn/memo.js +2 -0
  115. package/dist/fn/timing.d.ts +64 -0
  116. package/dist/fn/timing.js +2 -0
  117. package/dist/http/headers.d.ts +160 -0
  118. package/dist/http/headers.js +2 -0
  119. package/dist/http/index.d.ts +10 -0
  120. package/dist/http/index.js +2 -0
  121. package/dist/http/problem.d.ts +37 -0
  122. package/dist/http/problem.js +2 -0
  123. package/dist/http/response.d.ts +43 -0
  124. package/dist/http/response.js +2 -0
  125. package/dist/http/status.d.ts +169 -0
  126. package/dist/http/status.js +2 -0
  127. package/dist/index.d.ts +34 -0
  128. package/dist/index.js +2 -0
  129. package/dist/internal/keys.d.ts +6 -0
  130. package/dist/internal/keys.js +2 -0
  131. package/dist/is/index.d.ts +219 -0
  132. package/dist/is/index.js +2 -0
  133. package/dist/json/index.d.ts +9 -0
  134. package/dist/json/index.js +2 -0
  135. package/dist/json/internal.d.ts +12 -0
  136. package/dist/json/internal.js +2 -0
  137. package/dist/json/ndjson.d.ts +28 -0
  138. package/dist/json/ndjson.js +4 -0
  139. package/dist/json/parse.d.ts +45 -0
  140. package/dist/json/parse.js +2 -0
  141. package/dist/json/patch.d.ts +62 -0
  142. package/dist/json/patch.js +2 -0
  143. package/dist/json/pointer.d.ts +43 -0
  144. package/dist/json/pointer.js +2 -0
  145. package/dist/json/stringify.d.ts +42 -0
  146. package/dist/json/stringify.js +2 -0
  147. package/dist/linq/enumerable.d.ts +208 -0
  148. package/dist/linq/enumerable.js +2 -0
  149. package/dist/linq/index.d.ts +6 -0
  150. package/dist/linq/index.js +2 -0
  151. package/dist/linq/operators.d.ts +503 -0
  152. package/dist/linq/operators.js +2 -0
  153. package/dist/number/core.d.ts +164 -0
  154. package/dist/number/core.js +2 -0
  155. package/dist/number/format.d.ts +80 -0
  156. package/dist/number/format.js +2 -0
  157. package/dist/number/index.d.ts +12 -0
  158. package/dist/number/index.js +2 -0
  159. package/dist/number/internal.d.ts +18 -0
  160. package/dist/number/internal.js +2 -0
  161. package/dist/number/parse.d.ts +45 -0
  162. package/dist/number/parse.js +2 -0
  163. package/dist/number/words.d.ts +19 -0
  164. package/dist/number/words.js +2 -0
  165. package/dist/object/basic.d.ts +130 -0
  166. package/dist/object/basic.js +2 -0
  167. package/dist/object/deep.d.ts +90 -0
  168. package/dist/object/deep.js +2 -0
  169. package/dist/object/diff.d.ts +57 -0
  170. package/dist/object/diff.js +2 -0
  171. package/dist/object/index.d.ts +8 -0
  172. package/dist/object/index.js +2 -0
  173. package/dist/object/internal.d.ts +21 -0
  174. package/dist/object/internal.js +2 -0
  175. package/dist/object/path.d.ts +17 -0
  176. package/dist/object/path.js +2 -0
  177. package/dist/random/core.d.ts +14 -0
  178. package/dist/random/core.js +2 -0
  179. package/dist/random/index.d.ts +167 -0
  180. package/dist/random/index.js +2 -0
  181. package/dist/random/seeded.d.ts +27 -0
  182. package/dist/random/seeded.js +2 -0
  183. package/dist/sanitize/index.d.ts +8 -0
  184. package/dist/sanitize/index.js +2 -0
  185. package/dist/sanitize/pii.d.ts +48 -0
  186. package/dist/sanitize/pii.js +2 -0
  187. package/dist/sanitize/records.d.ts +100 -0
  188. package/dist/sanitize/records.js +2 -0
  189. package/dist/sanitize/text.d.ts +101 -0
  190. package/dist/sanitize/text.js +2 -0
  191. package/dist/set/index.d.ts +162 -0
  192. package/dist/set/index.js +2 -0
  193. package/dist/stats/index.d.ts +190 -0
  194. package/dist/stats/index.js +2 -0
  195. package/dist/string/index.d.ts +494 -0
  196. package/dist/string/index.js +8 -0
  197. package/dist/string/internal.d.ts +33 -0
  198. package/dist/string/internal.js +2 -0
  199. package/dist/string/words.d.ts +14 -0
  200. package/dist/string/words.js +2 -0
  201. package/dist/timezone/index.d.ts +76 -0
  202. package/dist/timezone/index.js +2 -0
  203. package/dist/url/index.d.ts +178 -0
  204. package/dist/url/index.js +2 -0
  205. package/dist/validate/builders.d.ts +6 -0
  206. package/dist/validate/builders.js +2 -0
  207. package/dist/validate/formats.d.ts +237 -0
  208. package/dist/validate/formats.js +2 -0
  209. package/dist/validate/index.d.ts +13 -0
  210. package/dist/validate/index.js +2 -0
  211. package/dist/validate/schema.d.ts +220 -0
  212. package/dist/validate/schema.js +2 -0
  213. package/dist/zip/index.d.ts +8 -0
  214. package/dist/zip/index.js +2 -0
  215. package/dist/zip/internal.d.ts +69 -0
  216. package/dist/zip/internal.js +2 -0
  217. package/dist/zip/reader.d.ts +56 -0
  218. package/dist/zip/reader.js +2 -0
  219. package/dist/zip/writer.d.ts +65 -0
  220. package/dist/zip/writer.js +2 -0
  221. package/package.json +150 -4
@@ -0,0 +1,62 @@
1
+ /** JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7396). Atomic and immutable. */
2
+ import { HelperError, type Result } from '../error/index.js';
3
+ /** One RFC 6902 operation. */
4
+ export type JsonPatchOperation = {
5
+ readonly op: 'add';
6
+ readonly path: string;
7
+ readonly value: unknown;
8
+ } | {
9
+ readonly op: 'remove';
10
+ readonly path: string;
11
+ } | {
12
+ readonly op: 'replace';
13
+ readonly path: string;
14
+ readonly value: unknown;
15
+ } | {
16
+ readonly op: 'move';
17
+ readonly from: string;
18
+ readonly path: string;
19
+ } | {
20
+ readonly op: 'copy';
21
+ readonly from: string;
22
+ readonly path: string;
23
+ } | {
24
+ readonly op: 'test';
25
+ readonly path: string;
26
+ readonly value: unknown;
27
+ };
28
+ export interface JsonPatchOptions {
29
+ /** Maximum operations per patch. Default 10,000. */
30
+ readonly maxOperations?: number;
31
+ }
32
+ /**
33
+ * Applies an RFC 6902 patch atomically: returns a new document or throws a `HelperError`
34
+ * (`details.operation` is the failing index); the input is never modified or partially patched.
35
+ * @example applyJsonPatch({ a: 1 }, [{ op: 'replace', path: '/a', value: 2 }]) // => { a: 2 }
36
+ */
37
+ export declare function applyJsonPatch(doc: unknown, patch: readonly JsonPatchOperation[] | readonly unknown[], options?: JsonPatchOptions): unknown;
38
+ /**
39
+ * `applyJsonPatch` returning a `Result` instead of throwing.
40
+ * @example
41
+ * tryApplyJsonPatch({ a: 1 }, [{ op: 'replace', path: '/a', value: 2 }]); // => { ok: true, value: { a: 2 } }
42
+ * const r = tryApplyJsonPatch({ a: 1 }, [{ op: 'remove', path: '/b' }]);
43
+ * r.ok; // => false
44
+ */
45
+ export declare function tryApplyJsonPatch(doc: unknown, patch: readonly JsonPatchOperation[] | readonly unknown[], options?: JsonPatchOptions): Result<unknown, HelperError>;
46
+ /**
47
+ * Creates an RFC 6902 patch that turns `a` into `b` (objects by key, arrays by index).
48
+ * @example createJsonPatch({ a: 1 }, { a: 1, b: 2 }) // => [{ op: 'add', path: '/b', value: 2 }]
49
+ */
50
+ export declare function createJsonPatch(a: unknown, b: unknown): JsonPatchOperation[];
51
+ /**
52
+ * Applies an RFC 7396 merge patch and returns a new document: `null` deletes, objects merge,
53
+ * everything else (arrays included) replaces. Unsafe keys throw `HLP_UNSAFE_KEY`.
54
+ * @example applyMergePatch({ a: 1, b: 2 }, { b: null, c: 3 }) // => { a: 1, c: 3 }
55
+ */
56
+ export declare function applyMergePatch(target: unknown, patch: unknown): unknown;
57
+ /**
58
+ * Creates an RFC 7396 merge patch turning `source` into `target`. Merge patches cannot express
59
+ * `null` values inside objects (they mean "delete"), so such targets do not round-trip.
60
+ * @example createMergePatch({ a: 1, b: 2 }, { a: 1, c: 3 }) // => { b: null, c: 3 }
61
+ */
62
+ export declare function createMergePatch(source: unknown, target: unknown): unknown;
@@ -0,0 +1,2 @@
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
+ import{HelperError as h,LimitError as S,ValidationError as J,err as T,ok as C}from"../error/index.js";import{isPlainObject as u}from"../is/index.js";import{assertSafeKey as w,hasOwn as l}from"../internal/keys.js";import{cloneJson as L,copyJsonContainer as _,isJsonContainer as R,jsonEqual as P}from"./internal.js";import{arrayIndex as g,formatPointer as y,found as E,parsePointer as j,resolve as I}from"./pointer.js";class b extends Error{constructor(o,n){super(n);this.code=o;this.text=n}code;text}const A=(i,r)=>{throw new b(i,r)},p=()=>A("HLP_JSON_PATCH_PATH_NOT_FOUND","A patch path does not resolve to a value."),d=()=>A("HLP_JSON_PATCH_INVALID","A patch operation is not valid.");class D{root;copied=new WeakSet;constructor(r){this.root=r}own(r){if(!R(r))return p();if(this.copied.has(r))return r;const o=_(r);return this.copied.add(o),o}parent(r){for(const n of r)w(n);this.root=this.own(this.root);let o=this.root;for(let n=0;n<r.length-1;n++){const e=r[n]??"";let s=e;Array.isArray(o)?s=g(o,e,!1)??p():l(o,e)||p();const c=this.own(o[s]);o[s]=c,o=c}return o}add(r,o){if(r.length===0){this.root=o;return}const n=this.parent(r),e=r[r.length-1]??"";Array.isArray(n)?n.splice(g(n,e,!0)??p(),0,o):n[e]=o}remove(r){r.length===0&&d();const o=this.parent(r),n=r[r.length-1]??"";Array.isArray(o)?o.splice(g(o,n,!1)??p(),1):l(o,n)?Reflect.deleteProperty(o,n):p()}replace(r,o){if(r.length===0){this.root=o;return}const n=this.parent(r),e=r[r.length-1]??"";Array.isArray(n)?n[g(n,e,!1)??p()]=o:l(n,e)?n[e]=o:p()}get(r){const o=I(this.root,r);return E(o)?o:p()}}function O(i,r){const o=i[r];if(typeof o!="string")return d();try{return j(o)}catch(n){if(n instanceof h&&n.kind==="limit")throw n;return d()}}function v(i){return l(i,"value")?i.value:d()}function H(i,r,o){const{maxOperations:n=1e4}=o;if(!Array.isArray(r))throw new J("HLP_JSON_PATCH_INVALID","A JSON Patch must be an array.");if(r.length>n)throw new S("HLP_JSON_PATCH_TOO_LARGE","The JSON Patch has too many operations.",{details:{maxOperations:n}});const e=new D(i);return r.forEach((s,c)=>{try{u(s)||d();const t=s,a=O(t,"path");switch(t.op){case"add":e.add(a,v(t));break;case"remove":e.remove(a);break;case"replace":e.replace(a,v(t));break;case"move":{const f=O(t,"from");f.length<a.length&&f.every((k,m)=>k===a[m])&&d();const N=e.get(f);if(f.length===a.length&&f.every((k,m)=>k===a[m]))break;e.remove(f),e.add(a,N);break}case"copy":e.add(a,L(e.get(O(t,"from"))));break;case"test":P(e.get(a),v(t))||A("HLP_JSON_PATCH_TEST_FAILED","A JSON Patch test operation failed.");break;default:d()}}catch(t){const a={operation:c};throw t instanceof b?new J(t.code,t.text,{details:a}):t instanceof h?new h(t.code,t.message,{details:a,kind:t.kind}):t}}),e.root}function U(i,r,o={}){return H(i,r,o)}function W(i,r,o={}){try{return C(H(i,r,o))}catch(n){return T(n instanceof h?n:new h("HLP_JSON_PATCH_FAILED","The JSON Patch could not be applied.",{cause:n}))}}function z(i,r){const o=[],n=(e,s,c)=>{if(Array.isArray(e)&&Array.isArray(s)){const t=Math.min(e.length,s.length);for(let a=0;a<t;a++)n(e[a],s[a],[...c,a]);for(let a=t;a<s.length;a++)o.push({op:"add",path:y([...c,a]),value:s[a]});for(let a=e.length-1;a>=t;a--)o.push({op:"remove",path:y([...c,a])});return}if(u(e)&&u(s)){for(const t of Object.keys(e))l(s,t)?n(e[t],s[t],[...c,t]):o.push({op:"remove",path:y([...c,t])});for(const t of Object.keys(s))l(e,t)||o.push({op:"add",path:y([...c,t]),value:s[t]});return}P(e,s)||o.push({op:"replace",path:y(c),value:s})};return n(i,r,[]),o}function F(i,r){if(!u(r))return r;const o=u(i)?_(i):{};for(const n of Object.keys(r)){w(n);const e=r[n];e===null?Reflect.deleteProperty(o,n):o[n]=F(l(o,n)?o[n]:void 0,e)}return o}function x(i,r){if(!u(i)||!u(r))return r;const o={};for(const n of Object.keys(i))l(r,n)||(w(n),o[n]=null);for(const n of Object.keys(r))l(i,n)&&P(i[n],r[n])||(w(n),o[n]=l(i,n)?x(i[n],r[n]):r[n]);return o}export{U as applyJsonPatch,F as applyMergePatch,z as createJsonPatch,x as createMergePatch,W as tryApplyJsonPatch};
@@ -0,0 +1,43 @@
1
+ import { type JsonContainer } from './internal.js';
2
+ export declare const notFound: () => never;
3
+ /**
4
+ * Parses a JSON Pointer (or its URI fragment form, `#/...`) into reference tokens.
5
+ * @example parsePointer('/a~1b/0') // => ['a/b', '0']
6
+ */
7
+ export declare function parsePointer(pointer: string): string[];
8
+ /**
9
+ * Formats reference tokens as a JSON Pointer; `fragment: true` gives the URI fragment form.
10
+ * @example formatPointer(['a/b', 0]) // => '/a~1b/0'
11
+ */
12
+ export declare function formatPointer(tokens: readonly (string | number)[], options?: {
13
+ readonly fragment?: boolean;
14
+ }): string;
15
+ /** Array index for a token, `-` -> length when `allowEnd`, otherwise undefined. */
16
+ export declare function arrayIndex(arr: readonly unknown[], token: string, allowEnd: boolean): number | undefined;
17
+ export declare function resolve(doc: unknown, tokens: readonly string[]): unknown;
18
+ /** True when `resolve` found a value. */
19
+ export declare function found(value: unknown): boolean;
20
+ /**
21
+ * Value at the pointer, or `undefined` when it does not resolve.
22
+ * @example getByPointer({ a: [1, 2] }, '/a/1') // => 2
23
+ */
24
+ export declare function getByPointer(doc: unknown, pointer: string): unknown;
25
+ /**
26
+ * True when the pointer resolves (even to `null`).
27
+ * @example hasPointer({ a: null }, '/a') // => true
28
+ */
29
+ export declare function hasPointer(doc: unknown, pointer: string): boolean;
30
+ /** Copies containers along `tokens` (all but the last) and calls `edit` on the copied parent. */
31
+ export declare function editAt(doc: unknown, tokens: readonly string[], edit: (parent: JsonContainer, token: string) => void): unknown;
32
+ /**
33
+ * Returns a copy with `value` set at the pointer. The parent must exist; on arrays the token
34
+ * must be an existing index (replaced), the length, or `-` (appended).
35
+ * @example setByPointer({ a: [1] }, '/a/-', 2) // => { a: [1, 2] }
36
+ */
37
+ export declare function setByPointer(doc: unknown, pointer: string, value: unknown): unknown;
38
+ /**
39
+ * Returns a copy without the value at the pointer (array elements are spliced out).
40
+ * Throws `HLP_JSON_POINTER_NOT_FOUND` when it does not resolve.
41
+ * @example removeByPointer({ a: 1, b: 2 }, '/a') // => { b: 2 }
42
+ */
43
+ export declare function removeByPointer(doc: unknown, pointer: string): unknown;
@@ -0,0 +1,2 @@
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
+ import{LimitError as h,ValidationError as y}from"../error/index.js";import{assertSafeKey as N,hasOwn as m}from"../internal/keys.js";import{copyJsonContainer as P,isJsonContainer as O}from"./internal.js";const _=1e5,x=/^(?:0|[1-9]\d{0,14})$/,f=()=>{throw new y("HLP_JSON_POINTER_INVALID","The JSON Pointer is not valid.")},c=()=>{throw new y("HLP_JSON_POINTER_NOT_FOUND","The JSON Pointer does not resolve to a value.")};function I(e){if(!e.includes("~"))return e;for(let n=0;n<e.length;n++)e[n]==="~"&&e[n+1]!=="0"&&e[n+1]!=="1"&&f();return e.replace(/~1/g,"/").replace(/~0/g,"~")}function a(e){if(typeof e!="string"&&f(),e.length>_)throw new h("HLP_JSON_POINTER_TOO_LONG","The JSON Pointer is too long.");let n=e;if(n.startsWith("#"))try{n=decodeURIComponent(n.slice(1))}catch{f()}return n===""?[]:(n.startsWith("/")||f(),n.slice(1).split("/").map(I))}function T(e,n={}){const r=e.map(t=>String(t).replace(/~/g,"~0").replace(/\//g,"~1"));return n.fragment?`#${r.map(t=>`/${encodeURIComponent(t)}`).join("")}`:r.map(t=>`/${t}`).join("")}function d(e,n,r){if(n==="-")return r?e.length:void 0;if(!x.test(n))return;const t=Number(n);return t<e.length||r&&t===e.length?t:void 0}const u=Symbol("missing");function g(e,n){let r=e;for(const t of n)if(Array.isArray(r)){const o=d(r,t,!1);if(o===void 0)return u;r=r[o]}else if(typeof r=="object"&&r!==null&&m(r,t))r=r[t];else return u;return r}function b(e){return e!==u}function k(e,n){const r=g(e,a(n));return r===u?void 0:r}function R(e,n){return g(e,a(n))!==u}function w(e,n,r){for(const o of n)N(o);const t=(o,i)=>{if(!O(o))return c();const s=P(o),l=n[i]??"";if(i===n.length-1)r(s,l);else{const p=g(o,[l]);p===u&&c(),s[Array.isArray(s)?String(d(s,l,!1)):l]=t(p,i+1)}return s};return t(e,0)}function v(e,n,r){const t=a(n);return t.length===0?r:w(e,t,(o,i)=>{if(Array.isArray(o)){const s=d(o,i,!0);s===void 0?c():o[s]=r}else o[i]=r})}function C(e,n){const r=a(n);return r.length===0?f():w(e,r,(t,o)=>{if(Array.isArray(t)){const i=d(t,o,!1);i===void 0?c():t.splice(i,1)}else m(t,o)?Reflect.deleteProperty(t,o):c()})}export{d as arrayIndex,w as editAt,T as formatPointer,b as found,k as getByPointer,R as hasPointer,c as notFound,a as parsePointer,C as removeByPointer,g as resolve,v as setByPointer};
@@ -0,0 +1,42 @@
1
+ export interface SafeJsonStringifyOptions {
2
+ /** `'placeholder'` (default) writes `circularPlaceholder`; `'error'` throws `HLP_JSON_CIRCULAR`. */
3
+ readonly circular?: 'placeholder' | 'error';
4
+ /** Default `'[Circular]'`. */
5
+ readonly circularPlaceholder?: string;
6
+ /** `'string'` (default) writes BigInts as decimal strings; `'error'` throws `HLP_JSON_BIGINT`. */
7
+ readonly bigint?: 'string' | 'error';
8
+ /** `'entries'` (default) writes maps as `[[key, value], ...]`; `'object'` as an object with stringified keys. */
9
+ readonly map?: 'entries' | 'object';
10
+ /** `'iso'` (default, `null` for invalid dates) or `'epoch'` milliseconds. */
11
+ readonly date?: 'iso' | 'epoch';
12
+ /** `'object'` (default) writes `{ name, message, code? }`; `'message'` writes the message string. */
13
+ readonly error?: 'object' | 'message';
14
+ /** Indentation, as for `JSON.stringify`. */
15
+ readonly indent?: number | string;
16
+ /** Maximum output length in UTF-16 code units; longer output throws `HLP_JSON_TOO_LONG`. */
17
+ readonly maxLength?: number;
18
+ }
19
+ /**
20
+ * `JSON.stringify` that never throws on cycles or BigInt (by default) and serializes Map, Set,
21
+ * Error and typed arrays. Shared (non-circular) references are written normally.
22
+ * Returns `undefined` for values JSON cannot represent at the top level (`undefined`, functions, symbols).
23
+ * @example safeJsonStringify({ n: 1n, s: new Set([1]) }) // => '{"n":"1","s":[1]}'
24
+ */
25
+ export declare function safeJsonStringify(value: unknown, options?: SafeJsonStringifyOptions): string | undefined;
26
+ /**
27
+ * Canonical JSON (RFC 8785-like): keys sorted by UTF-16 code units, no whitespace, numbers in
28
+ * ECMAScript form. `undefined`/function/symbol properties are omitted (array slots become `null`).
29
+ * Throws for non-finite numbers, BigInt, cycles and a top-level `undefined`.
30
+ * @example canonicalJson({ b: 1, a: [true, 1e21] }) // => '{"a":[true,1e+21],"b":1}'
31
+ */
32
+ export declare function canonicalJson(value: unknown): string;
33
+ /**
34
+ * Indented JSON via `safeJsonStringify` (empty string for unrepresentable values).
35
+ * @example prettyJson({ a: 1 }) // => '{\n "a": 1\n}'
36
+ */
37
+ export declare function prettyJson(value: unknown, indent?: number | string): string;
38
+ /**
39
+ * UTF-8 byte size of the value's JSON (via `safeJsonStringify`); 0 when unrepresentable.
40
+ * @example jsonByteSize({ s: 'é' }) // => 10
41
+ */
42
+ export declare function jsonByteSize(value: unknown, options?: SafeJsonStringifyOptions): number;
@@ -0,0 +1,2 @@
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
+ import{LimitError as x,ValidationError as p}from"../error/index.js";import{utf8Length as v}from"./internal.js";function J(s,o,a){o==="__proto__"?Object.defineProperty(s,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):s[o]=a}function j(s){return typeof s.toJSON=="function"}function _(s,o={}){const{circular:a="placeholder",circularPlaceholder:b="[Circular]",bigint:m="string",map:t="entries",date:c="iso",error:w="object",indent:g,maxLength:f}=o,d=new Set,u=(L,N)=>{let r=L;if(typeof r=="bigint"){if(m==="error")throw new p("HLP_JSON_BIGINT","BigInt values cannot be serialized.");return r.toString()}if(typeof r!="object"||r===null)return r;if(r instanceof Date){const e=r.getTime();return c==="epoch"?Number.isNaN(e)?null:e:Number.isNaN(e)?null:r.toISOString()}if(r instanceof Number||r instanceof String||r instanceof Boolean)return r.valueOf();if(j(r)&&(r=r.toJSON(N),typeof r!="object"||r===null))return u(r,N);const n=r;if(d.has(n)){if(a==="error")throw new p("HLP_JSON_CIRCULAR","The value contains a circular reference.");return b}d.add(n);let l;if(n instanceof Map)if(t==="object"){const e={};for(const[i,S]of n){const y=u(i,""),h=typeof y=="string"?y:JSON.stringify(y)??"";J(e,h,u(S,h))}l=e}else l=[...n].map(([e,i],S)=>[u(e,String(S)),u(i,String(S))]);else if(n instanceof Set)l=[...n].map((e,i)=>u(e,String(i)));else if(n instanceof Error)if(w==="message")l=n.message;else{const e=n.code;l={name:n.name,message:n.message,...typeof e=="string"?{code:e}:{}}}else if(Array.isArray(n))l=n.map((e,i)=>u(e,String(i)));else if(ArrayBuffer.isView(n)&&!(n instanceof DataView))l=Array.from(n,(e,i)=>u(e,String(i)));else{const e={};for(const i of Object.keys(n))J(e,i,u(n[i],i));l=e}return d.delete(n),l},k=JSON.stringify(u(s,""),null,g);if(k!==void 0&&f!==void 0&&k.length>f)throw new x("HLP_JSON_TOO_LONG","JSON output exceeds the maximum length.",{details:{maxLength:f}});return k}const O=()=>{throw new p("HLP_JSON_NOT_SERIALIZABLE","The value cannot be represented as canonical JSON.")};function I(s){const o=new Set,a=(b,m)=>{let t=b;switch(typeof t=="object"&&t!==null&&j(t)&&(t=t.toJSON(m)),(t instanceof Number||t instanceof String||t instanceof Boolean)&&(t=t.valueOf()),typeof t){case"string":return JSON.stringify(t);case"boolean":return t?"true":"false";case"number":return Number.isFinite(t)?JSON.stringify(t):O();case"bigint":return O();case"undefined":case"function":case"symbol":return;default:break}if(t===null)return"null";const c=t;if(o.has(c))throw new p("HLP_JSON_CIRCULAR","The value contains a circular reference.");o.add(c);let w;if(Array.isArray(c))w=`[${c.map((g,f)=>a(g,String(f))??"null").join(",")}]`;else{const g=[];for(const f of Object.keys(c).sort()){const d=a(c[f],f);d!==void 0&&g.push(`${JSON.stringify(f)}:${d}`)}w=`{${g.join(",")}}`}return o.delete(c),w};return a(s,"")??O()}function P(s,o=2){return _(s,{indent:o})??""}function T(s,o={}){const a=_(s,o);return a===void 0?0:v(a)}export{I as canonicalJson,T as jsonByteSize,P as prettyJson,_ as safeJsonStringify};
@@ -0,0 +1,208 @@
1
+ import type { EqualityComparer, KeyComparer, Lookup, OrderedSequence } from './operators.js';
2
+ type Predicate<T> = (item: T, index: number) => boolean;
3
+ /**
4
+ * Lazy, re-iterable sequence with the .NET LINQ surface.
5
+ * @example
6
+ * const big = from([1, 2, 3]).where((n) => n > 1);
7
+ * [...big]; // => [2, 3]
8
+ * big.count(); // => 2 // re-iterable
9
+ */
10
+ export declare class Enumerable<T> implements Iterable<T> {
11
+ #private;
12
+ /** @internal Use `from`. */
13
+ constructor(source: Iterable<T>);
14
+ [Symbol.iterator](): Iterator<T>;
15
+ /** Threads this sequence through pipeable operators; the last may be a terminal. */
16
+ pipe<A>(op1: (source: Iterable<T>) => A): A;
17
+ pipe<A, B>(op1: (source: Iterable<T>) => A, op2: (a: A) => B): B;
18
+ pipe<A, B, C>(op1: (source: Iterable<T>) => A, op2: (a: A) => B, op3: (b: B) => C): C;
19
+ pipe<A, B, C, D>(op1: (source: Iterable<T>) => A, op2: (a: A) => B, op3: (b: B) => C, op4: (c: C) => D): D;
20
+ /** Keeps items matching `predicate(item, index)`. */
21
+ where<S extends T>(predicate: (item: T, index: number) => item is S): Enumerable<S>;
22
+ where(predicate: Predicate<T>): Enumerable<T>;
23
+ /** Keeps items passing a type guard (`OfType`). */
24
+ whereType<S extends T>(guard: (item: T) => item is S): Enumerable<S>;
25
+ /** Maps items with `selector(item, index)`. */
26
+ select<U>(selector: (item: T, index: number) => U): Enumerable<U>;
27
+ /** Maps to sequences and flattens, optionally projecting `(item, child)`. */
28
+ selectMany<U>(selector: (item: T, index: number) => Iterable<U>): Enumerable<U>;
29
+ selectMany<U, R>(selector: (item: T, index: number) => Iterable<U>, result: (item: T, child: U) => R): Enumerable<R>;
30
+ /** Stable ascending sort by key; deferred until iterated. */
31
+ orderBy<K>(key: (item: T) => K, compare?: KeyComparer<K>): OrderedEnumerable<T>;
32
+ /** Stable descending sort by key; deferred until iterated. */
33
+ orderByDescending<K>(key: (item: T) => K, compare?: KeyComparer<K>): OrderedEnumerable<T>;
34
+ /** Reverses the sequence. */
35
+ reverse(): Enumerable<T>;
36
+ /** Groups by key; each group is an `Enumerable` with a `key`. */
37
+ groupBy<K>(key: (item: T) => K): Enumerable<EnumerableGrouping<K, T>>;
38
+ groupBy<K, E>(key: (item: T) => K, element: (item: T) => E): Enumerable<EnumerableGrouping<K, E>>;
39
+ groupBy<K, E, R>(key: (item: T) => K, element: (item: T) => E, result: (key: K, items: Enumerable<E>) => R): Enumerable<R>;
40
+ /** Inner equi-join (nullish keys never match). */
41
+ join<U, K, R>(inner: Iterable<U>, outerKey: (item: T) => K, innerKey: (item: U) => K, result: (outer: T, inner: U) => R): Enumerable<R>;
42
+ /** Pairs each item with an `Enumerable` of matching inner items. */
43
+ groupJoin<U, K, R>(inner: Iterable<U>, outerKey: (item: T) => K, innerKey: (item: U) => K, result: (outer: T, inners: Enumerable<U>) => R): Enumerable<R>;
44
+ /** Left outer join; `inner` is `undefined` when nothing matches. */
45
+ leftJoin<U, K, R>(inner: Iterable<U>, outerKey: (item: T) => K, innerKey: (item: U) => K, result: (outer: T, inner: U | undefined) => R): Enumerable<R>;
46
+ /** Removes duplicates (SameValueZero). */
47
+ distinct(): Enumerable<T>;
48
+ /** Removes items with a duplicate key. */
49
+ distinctBy(key: (item: T) => unknown): Enumerable<T>;
50
+ /** Distinct union with `other`. */
51
+ union(other: Iterable<T>): Enumerable<T>;
52
+ /** Union by key. */
53
+ unionBy(other: Iterable<T>, key: (item: T) => unknown): Enumerable<T>;
54
+ /** Distinct items also in `other`. */
55
+ intersect(other: Iterable<T>): Enumerable<T>;
56
+ /** Items whose key occurs in `other` (selector applied to both). */
57
+ intersectBy(other: Iterable<T>, key: (item: T) => unknown): Enumerable<T>;
58
+ /** Distinct items not in `other`. */
59
+ except(other: Iterable<T>): Enumerable<T>;
60
+ /** Items whose key does not occur in `other`. */
61
+ exceptBy(other: Iterable<T>, key: (item: T) => unknown): Enumerable<T>;
62
+ /** Appends `other`. */
63
+ concat(other: Iterable<T>): Enumerable<T>;
64
+ /** Pairs position-wise with `other`. */
65
+ zip<U>(other: Iterable<U>): Enumerable<[T, U]>;
66
+ zip<U, R>(other: Iterable<U>, result: (a: T, b: U) => R): Enumerable<R>;
67
+ /** Adds an item at the end. */
68
+ append(item: T): Enumerable<T>;
69
+ /** Adds an item at the start. */
70
+ prepend(item: T): Enumerable<T>;
71
+ /** Yields `value` alone when empty. */
72
+ defaultIfEmpty(value: T): Enumerable<T>;
73
+ /** Splits into arrays of `size`. */
74
+ chunk(size: number): Enumerable<T[]>;
75
+ /** First `count` items; stops pulling early. */
76
+ take(count: number): Enumerable<T>;
77
+ /** Leading items while `predicate` holds. */
78
+ takeWhile(predicate: Predicate<T>): Enumerable<T>;
79
+ /** Last `count` items. */
80
+ takeLast(count: number): Enumerable<T>;
81
+ /** Skips `count` items. */
82
+ skip(count: number): Enumerable<T>;
83
+ /** Skips leading items while `predicate` holds. */
84
+ skipWhile(predicate: Predicate<T>): Enumerable<T>;
85
+ /** Skips the last `count` items. */
86
+ skipLast(count: number): Enumerable<T>;
87
+ /** First matching item; throws `HLP_LINQ_NO_ELEMENTS`. */
88
+ first(predicate?: Predicate<T>): T;
89
+ /** First matching item or `defaultValue`. */
90
+ firstOrDefault(predicate?: Predicate<T>): T | undefined;
91
+ firstOrDefault<D>(predicate: Predicate<T> | undefined, defaultValue: D): T | D;
92
+ /** Last matching item; throws `HLP_LINQ_NO_ELEMENTS`. */
93
+ last(predicate?: Predicate<T>): T;
94
+ /** Last matching item or `defaultValue`. */
95
+ lastOrDefault(predicate?: Predicate<T>): T | undefined;
96
+ lastOrDefault<D>(predicate: Predicate<T> | undefined, defaultValue: D): T | D;
97
+ /** The only matching item; throws `HLP_LINQ_NO_ELEMENTS` / `HLP_LINQ_MULTIPLE_ELEMENTS`. */
98
+ single(predicate?: Predicate<T>): T;
99
+ /** The only matching item or `defaultValue`; throws `HLP_LINQ_MULTIPLE_ELEMENTS` for several. */
100
+ singleOrDefault(predicate?: Predicate<T>): T | undefined;
101
+ singleOrDefault<D>(predicate: Predicate<T> | undefined, defaultValue: D): T | D;
102
+ /** Item at `index` (negative from the end); throws `HLP_LINQ_INDEX_OUT_OF_RANGE`. */
103
+ elementAt(index: number): T;
104
+ /** Item at `index` or `defaultValue`. */
105
+ elementAtOrDefault(index: number): T | undefined;
106
+ elementAtOrDefault<D>(index: number, defaultValue: D): T | D;
107
+ /** True when any item matches (or the sequence is non-empty). */
108
+ any(predicate?: Predicate<T>): boolean;
109
+ /** True when every item matches. */
110
+ all(predicate: Predicate<T>): boolean;
111
+ /** True when the sequence contains `value`. */
112
+ contains(value: T, equals?: EqualityComparer<T>): boolean;
113
+ /** True when both sequences are equal item by item. */
114
+ sequenceEqual(other: Iterable<T>, equals?: EqualityComparer<T>): boolean;
115
+ /** Number of matching items. */
116
+ count(predicate?: Predicate<T>): number;
117
+ /** Compensated sum (0 when empty). */
118
+ sum(this: Enumerable<number>): number;
119
+ sum(selector: (item: T, index: number) => number): number;
120
+ /** Mean; throws `HLP_LINQ_NO_ELEMENTS` when empty. */
121
+ average(this: Enumerable<number>): number;
122
+ average(selector: (item: T, index: number) => number): number;
123
+ /** Smallest value (nullish ignored); throws `HLP_LINQ_NO_ELEMENTS`. */
124
+ min(): T;
125
+ min<R>(selector: (item: T, index: number) => R, compare?: KeyComparer<R>): R;
126
+ /** Largest value (nullish ignored); throws `HLP_LINQ_NO_ELEMENTS`. */
127
+ max(): T;
128
+ max<R>(selector: (item: T, index: number) => R, compare?: KeyComparer<R>): R;
129
+ /** Item with the smallest key, or `undefined`. */
130
+ minBy<K>(key: (item: T) => K, compare?: KeyComparer<K>): T | undefined;
131
+ /** Item with the largest key, or `undefined`. */
132
+ maxBy<K>(key: (item: T) => K, compare?: KeyComparer<K>): T | undefined;
133
+ /** Folds the sequence (see the pipeable `aggregate`). */
134
+ aggregate(fn: (acc: T, item: T, index: number) => T): T;
135
+ aggregate<A>(seed: A, fn: (acc: A, item: T, index: number) => A): A;
136
+ aggregate<A, R>(seed: A, fn: (acc: A, item: T, index: number) => A, result: (acc: A) => R): R;
137
+ /** Collects into an array. */
138
+ toArray(): T[];
139
+ /** Collects into a `Set`. */
140
+ toSet(): Set<T>;
141
+ /** Collects into a `Map`; throws `HLP_LINQ_DUPLICATE_KEY`. */
142
+ toMap<K>(key: (item: T) => K): Map<K, T>;
143
+ toMap<K, V>(key: (item: T) => K, value: (item: T) => V): Map<K, V>;
144
+ /** Alias of `toMap`. */
145
+ toDictionary<K>(key: (item: T) => K): Map<K, T>;
146
+ toDictionary<K, V>(key: (item: T) => K, value: (item: T) => V): Map<K, V>;
147
+ /** Collects into a `Lookup` (key -> values). */
148
+ toLookup<K>(key: (item: T) => K): Lookup<K, T>;
149
+ toLookup<K, V>(key: (item: T) => K, value: (item: T) => V): Lookup<K, V>;
150
+ /** Runs `action(item, index)` for every item. */
151
+ forEach(action: (item: T, index: number) => void): void;
152
+ }
153
+ /**
154
+ * Result of `orderBy`/`orderByDescending`; the only type exposing `thenBy`.
155
+ * @example
156
+ * const rows = [{ dept: 'IT', salary: 50 }, { dept: 'HR', salary: 40 }, { dept: 'IT', salary: 70 }];
157
+ * from(rows).orderBy((r) => r.dept).thenByDescending((r) => r.salary).select((r) => r.salary).toArray(); // => [40, 70, 50]
158
+ */
159
+ export declare class OrderedEnumerable<T> extends Enumerable<T> {
160
+ #private;
161
+ /** @internal */
162
+ constructor(ordered: OrderedSequence<T>);
163
+ /** Adds an ascending tie-breaker. */
164
+ thenBy<K>(key: (item: T) => K, compare?: KeyComparer<K>): OrderedEnumerable<T>;
165
+ /** Adds a descending tie-breaker. */
166
+ thenByDescending<K>(key: (item: T) => K, compare?: KeyComparer<K>): OrderedEnumerable<T>;
167
+ }
168
+ /**
169
+ * A group from `Enumerable#groupBy`: an `Enumerable` of the members with their `key`.
170
+ * @example
171
+ * const users = [{ name: 'Ada', dept: 'HR' }, { name: 'Ben', dept: 'IT' }, { name: 'Cy', dept: 'HR' }];
172
+ * from(users).groupBy((u) => u.dept).select((g) => ({ dept: g.key, n: g.count() })).toArray(); // => [{ dept: 'HR', n: 2 }, { dept: 'IT', n: 1 }]
173
+ */
174
+ export declare class EnumerableGrouping<K, T> extends Enumerable<T> {
175
+ readonly key: K;
176
+ /** @internal */
177
+ constructor(key: K, items: readonly T[]);
178
+ }
179
+ /**
180
+ * Wraps any iterable in a lazy, fluent `Enumerable`.
181
+ * @example
182
+ * const users = [
183
+ * { name: 'Ben', email: 'ben@x.io', active: true },
184
+ * { name: 'Cy', email: 'cy@x.io', active: false },
185
+ * { name: 'Ada', email: 'ada@x.io', active: true },
186
+ * ];
187
+ * from(users).where((u) => u.active).orderBy((u) => u.name).select((u) => u.email).toArray(); // => ['ada@x.io', 'ben@x.io']
188
+ */
189
+ export declare function from<T>(source: Iterable<T>): Enumerable<T>;
190
+ /**
191
+ * `count` consecutive integers from `start` (lazy).
192
+ * @example
193
+ * range(1, 3).toArray(); // => [1, 2, 3]
194
+ */
195
+ export declare function range(start: number, count: number): Enumerable<number>;
196
+ /**
197
+ * `value` repeated `count` times (lazy).
198
+ * @example
199
+ * repeat('x', 2).toArray(); // => ['x', 'x']
200
+ */
201
+ export declare function repeat<T>(value: T, count: number): Enumerable<T>;
202
+ /**
203
+ * An empty sequence.
204
+ * @example
205
+ * empty<number>().count(); // => 0
206
+ */
207
+ export declare function empty<T>(): Enumerable<T>;
208
+ export {};
@@ -0,0 +1,2 @@
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
+ import{ValidationError as s}from"../error/index.js";import*as t from"./operators.js";class n{#e;constructor(e){this.#e=e}[Symbol.iterator](){return this.#e[Symbol.iterator]()}pipe(...e){return e.reduce((r,i)=>i(r),this.#e)}#r(e){return new n(e(this.#e))}where(e){return this.#r(t.where(e))}whereType(e){return this.#r(t.whereType(e))}select(e){return this.#r(t.select(e))}selectMany(e,r){return r?this.#r(t.selectMany(e,r)):this.#r(t.selectMany(e))}orderBy(e,r){return new T(t.orderBy(e,r)(this.#e))}orderByDescending(e,r){return new T(t.orderByDescending(e,r)(this.#e))}reverse(){return this.#r(t.reverse())}groupBy(e,r,i){const m=r??(a=>a),o=t.groupBy(e,m)(this.#e);return new n(t.select(a=>i?i(a.key,new n(a.items)):new l(a.key,a.items))(o))}join(e,r,i,m){return this.#r(t.join(e,r,i,m))}groupJoin(e,r,i,m){return this.#r(t.groupJoin(e,r,i,(o,a)=>m(o,new n(a))))}leftJoin(e,r,i,m){return this.#r(t.leftJoin(e,r,i,m))}distinct(){return this.#r(t.distinct())}distinctBy(e){return this.#r(t.distinctBy(e))}union(e){return this.#r(t.union(e))}unionBy(e,r){return this.#r(t.unionBy(e,r))}intersect(e){return this.#r(t.intersect(e))}intersectBy(e,r){return this.#r(t.intersectBy(e,r))}except(e){return this.#r(t.except(e))}exceptBy(e,r){return this.#r(t.exceptBy(e,r))}concat(e){return this.#r(t.concat(e))}zip(e,r){return r?this.#r(t.zip(e,r)):this.#r(t.zip(e))}append(e){return this.#r(t.append(e))}prepend(e){return this.#r(t.prepend(e))}defaultIfEmpty(e){return this.#r(t.defaultIfEmpty(e))}chunk(e){return this.#r(t.chunk(e))}take(e){return this.#r(t.take(e))}takeWhile(e){return this.#r(t.takeWhile(e))}takeLast(e){return this.#r(t.takeLast(e))}skip(e){return this.#r(t.skip(e))}skipWhile(e){return this.#r(t.skipWhile(e))}skipLast(e){return this.#r(t.skipLast(e))}first(e){return t.first(e)(this.#e)}firstOrDefault(e,r){return t.firstOrDefault(e,r)(this.#e)}last(e){return t.last(e)(this.#e)}lastOrDefault(e,r){return t.lastOrDefault(e,r)(this.#e)}single(e){return t.single(e)(this.#e)}singleOrDefault(e,r){return t.singleOrDefault(e,r)(this.#e)}elementAt(e){return t.elementAt(e)(this.#e)}elementAtOrDefault(e,r){return t.elementAtOrDefault(e,r)(this.#e)}any(e){return t.any(e)(this.#e)}all(e){return t.all(e)(this.#e)}contains(e,r){return t.contains(e,r)(this.#e)}sequenceEqual(e,r){return t.sequenceEqual(e,r)(this.#e)}count(e){return t.count(e)(this.#e)}sum(e){return e?t.sum(e)(this.#e):t.sum()(this.#e)}average(e){return e?t.average(e)(this.#e):t.average()(this.#e)}min(e,r){return e?t.min(e,r)(this.#e):t.min()(this.#e)}max(e,r){return e?t.max(e,r)(this.#e):t.max()(this.#e)}minBy(e,r){return t.minBy(e,r)(this.#e)}maxBy(e,r){return t.maxBy(e,r)(this.#e)}aggregate(...e){return t.aggregate(...e)(this.#e)}toArray(){return[...this.#e]}toSet(){return new Set(this.#e)}toMap(e,r){return r?t.toMap(e,r)(this.#e):t.toMap(e)(this.#e)}toDictionary(e,r){return r?t.toMap(e,r)(this.#e):t.toMap(e)(this.#e)}toLookup(e,r){return r?t.toLookup(e,r)(this.#e):t.toLookup(e)(this.#e)}forEach(e){t.forEach(e)(this.#e)}}class T extends n{#e;constructor(e){super(e),this.#e=e}thenBy(e,r){return new T(this.#e.thenBy(e,r))}thenByDescending(e,r){return new T(this.#e.thenByDescending(e,r))}}class l extends n{key;constructor(e,r){super(r),this.key=e}}function d(u){return u instanceof n?u:new n(u)}function p(u,e){if(t.assertCount(e),!Number.isFinite(u))throw new s("HLP_LINQ_INVALID_ARGUMENT","Range start must be finite.");return new n({*[Symbol.iterator](){for(let r=0;r<e;r++)yield u+r}})}function c(u,e){return t.assertCount(e),new n({*[Symbol.iterator](){for(let r=0;r<e;r++)yield u}})}function h(){return new n([])}export{n as Enumerable,l as EnumerableGrouping,T as OrderedEnumerable,h as empty,d as from,p as range,c as repeat};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Lazy LINQ (docs/PLAN-HELPERS.md section 2, decision 4): pipeable operators for tree-shaking
3
+ * (`pipe(src, where(p), select(f), toArray())`) and the fluent `from(src)` wrapper.
4
+ */
5
+ export * from './operators.js';
6
+ export { Enumerable, EnumerableGrouping, OrderedEnumerable, empty, from, range, repeat } from './enumerable.js';
@@ -0,0 +1,2 @@
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
+ export*from"./operators.js";import{Enumerable as o,EnumerableGrouping as a,OrderedEnumerable as n,empty as p,from as t,range as u,repeat as b}from"./enumerable.js";export{o as Enumerable,a as EnumerableGrouping,n as OrderedEnumerable,p as empty,t as from,u as range,b as repeat};