@rimbu/base 0.11.4 → 1.0.0-alpha.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 (70) hide show
  1. package/{src/arr.ts → dist/bun/arr.mts} +1 -1
  2. package/dist/bun/index.mts +6 -0
  3. package/dist/bun/internal.mts +1 -0
  4. package/dist/cjs/arr.cjs +177 -0
  5. package/dist/cjs/entry.cjs +37 -0
  6. package/dist/cjs/index.cjs +247 -0
  7. package/dist/cjs/internal.cjs +32 -0
  8. package/dist/cjs/plain-object.cjs +37 -0
  9. package/dist/cjs/rimbu-error.cjs +75 -0
  10. package/dist/cjs/token.cjs +30 -0
  11. package/dist/{module/arr.js → esm/arr.mjs} +1 -1
  12. package/dist/esm/arr.mjs.map +1 -0
  13. package/dist/{module/entry.js → esm/entry.mjs} +1 -1
  14. package/dist/esm/entry.mjs.map +1 -0
  15. package/dist/esm/index.mjs +6 -0
  16. package/dist/esm/index.mjs.map +1 -0
  17. package/dist/esm/internal.mjs +2 -0
  18. package/dist/esm/internal.mjs.map +1 -0
  19. package/dist/{module/plain-object.js → esm/plain-object.mjs} +1 -1
  20. package/dist/esm/plain-object.mjs.map +1 -0
  21. package/dist/{module/rimbu-error.js → esm/rimbu-error.mjs} +1 -1
  22. package/dist/esm/rimbu-error.mjs.map +1 -0
  23. package/dist/{module/token.js → esm/token.mjs} +1 -1
  24. package/dist/esm/token.mjs.map +1 -0
  25. package/dist/types/{arr.d.ts → arr.d.mts} +1 -1
  26. package/dist/types/index.d.mts +5 -0
  27. package/dist/types/internal.d.mts +1 -0
  28. package/package.json +27 -21
  29. package/src/arr.mts +195 -0
  30. package/src/entry.mts +9 -0
  31. package/src/index.mts +6 -0
  32. package/src/internal.mts +1 -0
  33. package/src/plain-object.mts +95 -0
  34. package/src/rimbu-error.mts +39 -0
  35. package/src/token.mts +2 -0
  36. package/dist/main/arr.js +0 -169
  37. package/dist/main/arr.js.map +0 -1
  38. package/dist/main/entry.js +0 -14
  39. package/dist/main/entry.js.map +0 -1
  40. package/dist/main/index.js +0 -10
  41. package/dist/main/index.js.map +0 -1
  42. package/dist/main/internal.js +0 -5
  43. package/dist/main/internal.js.map +0 -1
  44. package/dist/main/plain-object.js +0 -27
  45. package/dist/main/plain-object.js.map +0 -1
  46. package/dist/main/rimbu-error.js +0 -54
  47. package/dist/main/rimbu-error.js.map +0 -1
  48. package/dist/main/token.js +0 -5
  49. package/dist/main/token.js.map +0 -1
  50. package/dist/module/arr.js.map +0 -1
  51. package/dist/module/entry.js.map +0 -1
  52. package/dist/module/index.js +0 -6
  53. package/dist/module/index.js.map +0 -1
  54. package/dist/module/internal.js +0 -2
  55. package/dist/module/internal.js.map +0 -1
  56. package/dist/module/plain-object.js.map +0 -1
  57. package/dist/module/rimbu-error.js.map +0 -1
  58. package/dist/module/token.js.map +0 -1
  59. package/dist/types/index.d.ts +0 -5
  60. package/dist/types/internal.d.ts +0 -1
  61. package/src/index.ts +0 -6
  62. package/src/internal.ts +0 -1
  63. /package/{src/entry.ts → dist/bun/entry.mts} +0 -0
  64. /package/{src/plain-object.ts → dist/bun/plain-object.mts} +0 -0
  65. /package/{src/rimbu-error.ts → dist/bun/rimbu-error.mts} +0 -0
  66. /package/{src/token.ts → dist/bun/token.mts} +0 -0
  67. /package/dist/types/{entry.d.ts → entry.d.mts} +0 -0
  68. /package/dist/types/{plain-object.d.ts → plain-object.d.mts} +0 -0
  69. /package/dist/types/{rimbu-error.d.ts → rimbu-error.d.mts} +0 -0
  70. /package/dist/types/{token.d.ts → token.d.mts} +0 -0
@@ -1,4 +1,4 @@
1
- import { Update, TraverseState, ArrayNonEmpty } from '@rimbu/common';
1
+ import { Update, TraverseState, type ArrayNonEmpty } from '@rimbu/common';
2
2
 
3
3
  // Returns a copy of the array with the given value appended
4
4
  export function append<T>(array: readonly T[], value: T): ArrayNonEmpty<T> {
@@ -0,0 +1,6 @@
1
+ export * as Arr from './arr.mts';
2
+ export * as Entry from './entry.mts';
3
+ export * as RimbuError from './rimbu-error.mts';
4
+ export * from './plain-object.mts';
5
+
6
+ export * from './internal.mts';
@@ -0,0 +1 @@
1
+ export * from './token.mts';
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);
19
+
20
+ // src/arr.mts
21
+ var arr_exports = {};
22
+ __export(arr_exports, {
23
+ append: () => append,
24
+ concat: () => concat,
25
+ copySparse: () => copySparse,
26
+ forEach: () => forEach,
27
+ init: () => init,
28
+ insert: () => insert,
29
+ last: () => last,
30
+ map: () => map,
31
+ mapSparse: () => mapSparse,
32
+ mod: () => mod,
33
+ prepend: () => prepend,
34
+ reverse: () => reverse,
35
+ reverseMap: () => reverseMap,
36
+ splice: () => splice,
37
+ tail: () => tail,
38
+ update: () => update
39
+ });
40
+ module.exports = __toCommonJS(arr_exports);
41
+ var import_common = require("@rimbu/common");
42
+ function append(array, value) {
43
+ const clone = array.slice();
44
+ clone.push(value);
45
+ return clone;
46
+ }
47
+ function concat(first, second) {
48
+ if (first.length === 0)
49
+ return second;
50
+ if (second.length === 0)
51
+ return first;
52
+ return first.concat(second);
53
+ }
54
+ function reverse(array, start = 0, end = array.length - 1) {
55
+ const length = end - start + 1;
56
+ const res = [];
57
+ let arrayIndex = start - 1;
58
+ let resIndex = length - 1;
59
+ while (++arrayIndex <= end)
60
+ res[resIndex--] = array[arrayIndex];
61
+ return res;
62
+ }
63
+ function forEach(array, f, state = (0, import_common.TraverseState)(), reversed = false) {
64
+ if (state.halted)
65
+ return;
66
+ const { halt } = state;
67
+ if (reversed) {
68
+ let i = array.length;
69
+ while (!state.halted && --i >= 0) {
70
+ f(array[i], state.nextIndex(), halt);
71
+ }
72
+ } else {
73
+ const length = array.length;
74
+ let i = -1;
75
+ while (!state.halted && ++i < length) {
76
+ f(array[i], state.nextIndex(), halt);
77
+ }
78
+ }
79
+ }
80
+ function map(array, f, indexOffset = 0) {
81
+ const result = [];
82
+ let index = indexOffset;
83
+ let i = -1;
84
+ const length = array.length;
85
+ while (++i < length) {
86
+ result[i] = f(array[i], index++);
87
+ }
88
+ return result;
89
+ }
90
+ function reverseMap(array, f, indexOffset = 0) {
91
+ const result = [];
92
+ let index = indexOffset;
93
+ let arrayIndex = array.length;
94
+ let resultIndex = 0;
95
+ while (--arrayIndex >= 0)
96
+ result[resultIndex++] = f(array[arrayIndex], index++);
97
+ return result;
98
+ }
99
+ function prepend(array, value) {
100
+ const clone = array.slice();
101
+ clone.unshift(value);
102
+ return clone;
103
+ }
104
+ function last(arr) {
105
+ return arr[arr.length - 1];
106
+ }
107
+ function update(arr, index, updater) {
108
+ if (index < 0 || index >= arr.length)
109
+ return arr;
110
+ const curValue = arr[index];
111
+ const newValue = (0, import_common.Update)(curValue, updater);
112
+ if (Object.is(newValue, curValue))
113
+ return arr;
114
+ const newArr = arr.slice();
115
+ newArr[index] = newValue;
116
+ return newArr;
117
+ }
118
+ function mod(arr, index, f) {
119
+ if (index < 0 || index >= arr.length)
120
+ return arr;
121
+ const curValue = arr[index];
122
+ const newValue = f(curValue);
123
+ if (Object.is(newValue, curValue))
124
+ return arr;
125
+ const newArr = arr.slice();
126
+ newArr[index] = newValue;
127
+ return newArr;
128
+ }
129
+ function insert(arr, index, value) {
130
+ const clone = arr.slice();
131
+ clone.splice(index, 0, value);
132
+ return clone;
133
+ }
134
+ function tail(arr) {
135
+ return arr.slice(1);
136
+ }
137
+ function init(arr) {
138
+ return arr.slice(0, arr.length - 1);
139
+ }
140
+ function splice(arr, start, deleteCount, ...items) {
141
+ const clone = arr.slice();
142
+ clone.splice(start, deleteCount, ...items);
143
+ return clone;
144
+ }
145
+ function copySparse(arr) {
146
+ const clone = [];
147
+ for (const key in arr) {
148
+ clone[key] = arr[key];
149
+ }
150
+ return clone;
151
+ }
152
+ function mapSparse(arr, f) {
153
+ const result = Array(arr.length);
154
+ for (const key in arr) {
155
+ result[key] = f(arr[key], key);
156
+ }
157
+ return result;
158
+ }
159
+ // Annotate the CommonJS export names for ESM import in node:
160
+ 0 && (module.exports = {
161
+ append,
162
+ concat,
163
+ copySparse,
164
+ forEach,
165
+ init,
166
+ insert,
167
+ last,
168
+ map,
169
+ mapSparse,
170
+ mod,
171
+ prepend,
172
+ reverse,
173
+ reverseMap,
174
+ splice,
175
+ tail,
176
+ update
177
+ });
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/entry.mts
21
+ var entry_exports = {};
22
+ __export(entry_exports, {
23
+ first: () => first,
24
+ second: () => second
25
+ });
26
+ module.exports = __toCommonJS(entry_exports);
27
+ function first(entry) {
28
+ return entry[0];
29
+ }
30
+ function second(entry) {
31
+ return entry[1];
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ first,
36
+ second
37
+ });
@@ -0,0 +1,247 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);
19
+
20
+ // src/index.mts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ Arr: () => arr_exports,
24
+ Entry: () => entry_exports,
25
+ RimbuError: () => rimbu_error_exports,
26
+ Token: () => Token,
27
+ isIterable: () => isIterable,
28
+ isPlainObj: () => isPlainObj
29
+ });
30
+ module.exports = __toCommonJS(src_exports);
31
+
32
+ // src/arr.mts
33
+ var arr_exports = {};
34
+ __export(arr_exports, {
35
+ append: () => append,
36
+ concat: () => concat,
37
+ copySparse: () => copySparse,
38
+ forEach: () => forEach,
39
+ init: () => init,
40
+ insert: () => insert,
41
+ last: () => last,
42
+ map: () => map,
43
+ mapSparse: () => mapSparse,
44
+ mod: () => mod,
45
+ prepend: () => prepend,
46
+ reverse: () => reverse,
47
+ reverseMap: () => reverseMap,
48
+ splice: () => splice,
49
+ tail: () => tail,
50
+ update: () => update
51
+ });
52
+ var import_common = require("@rimbu/common");
53
+ function append(array, value) {
54
+ const clone = array.slice();
55
+ clone.push(value);
56
+ return clone;
57
+ }
58
+ function concat(first2, second2) {
59
+ if (first2.length === 0)
60
+ return second2;
61
+ if (second2.length === 0)
62
+ return first2;
63
+ return first2.concat(second2);
64
+ }
65
+ function reverse(array, start = 0, end = array.length - 1) {
66
+ const length = end - start + 1;
67
+ const res = [];
68
+ let arrayIndex = start - 1;
69
+ let resIndex = length - 1;
70
+ while (++arrayIndex <= end)
71
+ res[resIndex--] = array[arrayIndex];
72
+ return res;
73
+ }
74
+ function forEach(array, f, state = (0, import_common.TraverseState)(), reversed = false) {
75
+ if (state.halted)
76
+ return;
77
+ const { halt } = state;
78
+ if (reversed) {
79
+ let i = array.length;
80
+ while (!state.halted && --i >= 0) {
81
+ f(array[i], state.nextIndex(), halt);
82
+ }
83
+ } else {
84
+ const length = array.length;
85
+ let i = -1;
86
+ while (!state.halted && ++i < length) {
87
+ f(array[i], state.nextIndex(), halt);
88
+ }
89
+ }
90
+ }
91
+ function map(array, f, indexOffset = 0) {
92
+ const result = [];
93
+ let index = indexOffset;
94
+ let i = -1;
95
+ const length = array.length;
96
+ while (++i < length) {
97
+ result[i] = f(array[i], index++);
98
+ }
99
+ return result;
100
+ }
101
+ function reverseMap(array, f, indexOffset = 0) {
102
+ const result = [];
103
+ let index = indexOffset;
104
+ let arrayIndex = array.length;
105
+ let resultIndex = 0;
106
+ while (--arrayIndex >= 0)
107
+ result[resultIndex++] = f(array[arrayIndex], index++);
108
+ return result;
109
+ }
110
+ function prepend(array, value) {
111
+ const clone = array.slice();
112
+ clone.unshift(value);
113
+ return clone;
114
+ }
115
+ function last(arr) {
116
+ return arr[arr.length - 1];
117
+ }
118
+ function update(arr, index, updater) {
119
+ if (index < 0 || index >= arr.length)
120
+ return arr;
121
+ const curValue = arr[index];
122
+ const newValue = (0, import_common.Update)(curValue, updater);
123
+ if (Object.is(newValue, curValue))
124
+ return arr;
125
+ const newArr = arr.slice();
126
+ newArr[index] = newValue;
127
+ return newArr;
128
+ }
129
+ function mod(arr, index, f) {
130
+ if (index < 0 || index >= arr.length)
131
+ return arr;
132
+ const curValue = arr[index];
133
+ const newValue = f(curValue);
134
+ if (Object.is(newValue, curValue))
135
+ return arr;
136
+ const newArr = arr.slice();
137
+ newArr[index] = newValue;
138
+ return newArr;
139
+ }
140
+ function insert(arr, index, value) {
141
+ const clone = arr.slice();
142
+ clone.splice(index, 0, value);
143
+ return clone;
144
+ }
145
+ function tail(arr) {
146
+ return arr.slice(1);
147
+ }
148
+ function init(arr) {
149
+ return arr.slice(0, arr.length - 1);
150
+ }
151
+ function splice(arr, start, deleteCount, ...items) {
152
+ const clone = arr.slice();
153
+ clone.splice(start, deleteCount, ...items);
154
+ return clone;
155
+ }
156
+ function copySparse(arr) {
157
+ const clone = [];
158
+ for (const key in arr) {
159
+ clone[key] = arr[key];
160
+ }
161
+ return clone;
162
+ }
163
+ function mapSparse(arr, f) {
164
+ const result = Array(arr.length);
165
+ for (const key in arr) {
166
+ result[key] = f(arr[key], key);
167
+ }
168
+ return result;
169
+ }
170
+
171
+ // src/entry.mts
172
+ var entry_exports = {};
173
+ __export(entry_exports, {
174
+ first: () => first,
175
+ second: () => second
176
+ });
177
+ function first(entry) {
178
+ return entry[0];
179
+ }
180
+ function second(entry) {
181
+ return entry[1];
182
+ }
183
+
184
+ // src/rimbu-error.mts
185
+ var rimbu_error_exports = {};
186
+ __export(rimbu_error_exports, {
187
+ EmptyCollectionAssumedNonEmptyError: () => EmptyCollectionAssumedNonEmptyError,
188
+ InvalidStateError: () => InvalidStateError,
189
+ InvalidUsageError: () => InvalidUsageError,
190
+ ModifiedBuilderWhileLoopingOverItError: () => ModifiedBuilderWhileLoopingOverItError,
191
+ throwEmptyCollectionAssumedNonEmptyError: () => throwEmptyCollectionAssumedNonEmptyError,
192
+ throwInvalidStateError: () => throwInvalidStateError,
193
+ throwInvalidUsageError: () => throwInvalidUsageError,
194
+ throwModifiedBuilderWhileLoopingOverItError: () => throwModifiedBuilderWhileLoopingOverItError
195
+ });
196
+ var import_common2 = require("@rimbu/common");
197
+ var EmptyCollectionAssumedNonEmptyError = class extends import_common2.ErrBase.CustomError {
198
+ constructor() {
199
+ super("empty collection was assumbed to be non-empty");
200
+ }
201
+ };
202
+ var ModifiedBuilderWhileLoopingOverItError = class extends import_common2.ErrBase.CustomError {
203
+ constructor() {
204
+ super("an attempt was made to modify a builder while looping over it");
205
+ }
206
+ };
207
+ var InvalidStateError = class extends import_common2.ErrBase.CustomError {
208
+ constructor() {
209
+ super(
210
+ "something happend that shouldn't happen, please consider creating an issue"
211
+ );
212
+ }
213
+ };
214
+ var InvalidUsageError = class extends import_common2.ErrBase.CustomError {
215
+ };
216
+ function throwEmptyCollectionAssumedNonEmptyError() {
217
+ throw new EmptyCollectionAssumedNonEmptyError();
218
+ }
219
+ function throwModifiedBuilderWhileLoopingOverItError() {
220
+ throw new ModifiedBuilderWhileLoopingOverItError();
221
+ }
222
+ function throwInvalidStateError() {
223
+ throw new InvalidStateError();
224
+ }
225
+ function throwInvalidUsageError(msg) {
226
+ throw new InvalidUsageError(msg);
227
+ }
228
+
229
+ // src/plain-object.mts
230
+ function isPlainObj(obj) {
231
+ return typeof obj === "object" && null !== obj && (obj.constructor === Object || !(obj.constructor instanceof Function)) && !(Symbol.iterator in obj) && !(Symbol.asyncIterator in obj);
232
+ }
233
+ function isIterable(obj) {
234
+ return obj !== null && typeof obj === "object" && Symbol.iterator in obj;
235
+ }
236
+
237
+ // src/token.mts
238
+ var Token = Symbol("Token");
239
+ // Annotate the CommonJS export names for ESM import in node:
240
+ 0 && (module.exports = {
241
+ Arr,
242
+ Entry,
243
+ RimbuError,
244
+ Token,
245
+ isIterable,
246
+ isPlainObj
247
+ });
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/internal.mts
21
+ var internal_exports = {};
22
+ __export(internal_exports, {
23
+ Token: () => Token
24
+ });
25
+ module.exports = __toCommonJS(internal_exports);
26
+
27
+ // src/token.mts
28
+ var Token = Symbol("Token");
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ Token
32
+ });
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/plain-object.mts
21
+ var plain_object_exports = {};
22
+ __export(plain_object_exports, {
23
+ isIterable: () => isIterable,
24
+ isPlainObj: () => isPlainObj
25
+ });
26
+ module.exports = __toCommonJS(plain_object_exports);
27
+ function isPlainObj(obj) {
28
+ return typeof obj === "object" && null !== obj && (obj.constructor === Object || !(obj.constructor instanceof Function)) && !(Symbol.iterator in obj) && !(Symbol.asyncIterator in obj);
29
+ }
30
+ function isIterable(obj) {
31
+ return obj !== null && typeof obj === "object" && Symbol.iterator in obj;
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ isIterable,
36
+ isPlainObj
37
+ });
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/rimbu-error.mts
21
+ var rimbu_error_exports = {};
22
+ __export(rimbu_error_exports, {
23
+ EmptyCollectionAssumedNonEmptyError: () => EmptyCollectionAssumedNonEmptyError,
24
+ InvalidStateError: () => InvalidStateError,
25
+ InvalidUsageError: () => InvalidUsageError,
26
+ ModifiedBuilderWhileLoopingOverItError: () => ModifiedBuilderWhileLoopingOverItError,
27
+ throwEmptyCollectionAssumedNonEmptyError: () => throwEmptyCollectionAssumedNonEmptyError,
28
+ throwInvalidStateError: () => throwInvalidStateError,
29
+ throwInvalidUsageError: () => throwInvalidUsageError,
30
+ throwModifiedBuilderWhileLoopingOverItError: () => throwModifiedBuilderWhileLoopingOverItError
31
+ });
32
+ module.exports = __toCommonJS(rimbu_error_exports);
33
+ var import_common = require("@rimbu/common");
34
+ var EmptyCollectionAssumedNonEmptyError = class extends import_common.ErrBase.CustomError {
35
+ constructor() {
36
+ super("empty collection was assumbed to be non-empty");
37
+ }
38
+ };
39
+ var ModifiedBuilderWhileLoopingOverItError = class extends import_common.ErrBase.CustomError {
40
+ constructor() {
41
+ super("an attempt was made to modify a builder while looping over it");
42
+ }
43
+ };
44
+ var InvalidStateError = class extends import_common.ErrBase.CustomError {
45
+ constructor() {
46
+ super(
47
+ "something happend that shouldn't happen, please consider creating an issue"
48
+ );
49
+ }
50
+ };
51
+ var InvalidUsageError = class extends import_common.ErrBase.CustomError {
52
+ };
53
+ function throwEmptyCollectionAssumedNonEmptyError() {
54
+ throw new EmptyCollectionAssumedNonEmptyError();
55
+ }
56
+ function throwModifiedBuilderWhileLoopingOverItError() {
57
+ throw new ModifiedBuilderWhileLoopingOverItError();
58
+ }
59
+ function throwInvalidStateError() {
60
+ throw new InvalidStateError();
61
+ }
62
+ function throwInvalidUsageError(msg) {
63
+ throw new InvalidUsageError(msg);
64
+ }
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ EmptyCollectionAssumedNonEmptyError,
68
+ InvalidStateError,
69
+ InvalidUsageError,
70
+ ModifiedBuilderWhileLoopingOverItError,
71
+ throwEmptyCollectionAssumedNonEmptyError,
72
+ throwInvalidStateError,
73
+ throwInvalidUsageError,
74
+ throwModifiedBuilderWhileLoopingOverItError
75
+ });
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/token.mts
21
+ var token_exports = {};
22
+ __export(token_exports, {
23
+ Token: () => Token
24
+ });
25
+ module.exports = __toCommonJS(token_exports);
26
+ var Token = Symbol("Token");
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ Token
30
+ });
@@ -136,4 +136,4 @@ export function mapSparse(arr, f) {
136
136
  }
137
137
  return result;
138
138
  }
139
- //# sourceMappingURL=arr.js.map
139
+ //# sourceMappingURL=arr.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arr.mjs","sourceRoot":"","sources":["../../src/arr.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAsB,MAAM,eAAe,CAAC;AAE1E,4DAA4D;AAC5D,MAAM,UAAU,MAAM,CAAI,KAAmB,EAAE,KAAQ;IACrD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;IAC5B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,OAAO,KAAyB,CAAC;AACnC,CAAC;AAED,iHAAiH;AACjH,MAAM,UAAU,MAAM,CACpB,KAAmB,EACnB,MAAoB;IAEpB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC;IACtC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACtC,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED,uGAAuG;AACvG,MAAM,U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DAAyD;AACzD,MAAM,UAAU,IAAI,CAAI,GAAiB;IACvC,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,IAAI,CAAI,GAAiB;IACvC,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,MAAM,CACpB,GAAiB,EACjB,KAAa,EACb,WAAmB,EACnB,GAAG,KAAU;IAEb,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC;IAC1B,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,CAAC;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,2GAA2G;AAC3G,MAAM,UAAU,UAAU,CAAI,GAAiB;IAC7C,MAAM,KAAK,GAAQ,EAAE,CAAC;IACtB,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACrB,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;KACvB;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,+GAA+G;AAC/G,0CAA0C;AAC1C,MAAM,UAAU,SAAS,CACvB,GAAiB,EACjB,CAAkC;IAElC,MAAM,MAAM,GAAS,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAEvC,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACrB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAU,CAAC,CAAC;KACvC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -6,4 +6,4 @@ export function first(entry) {
6
6
  export function second(entry) {
7
7
  return entry[1];
8
8
  }
9
- //# sourceMappingURL=entry.js.map
9
+ //# sourceMappingURL=entry.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.mjs","sourceRoot":"","sources":["../../src/entry.mts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,MAAM,UAAU,KAAK,CAAO,KAAsB;IAChD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,MAAM,CAAO,KAAsB;IACjD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * as Arr from './arr.mjs';
2
+ export * as Entry from './entry.mjs';
3
+ export * as RimbuError from './rimbu-error.mjs';
4
+ export * from './plain-object.mjs';
5
+ export * from './internal.mjs';
6
+ //# sourceMappingURL=index.mjs.map