@rimbu/base 2.0.1 → 2.0.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.
- package/README.md +22 -20
- package/dist/cjs/arr.cjs +25 -25
- package/dist/cjs/arr.cjs.map +1 -1
- package/dist/cjs/entry.cjs +2 -3
- package/dist/cjs/entry.cjs.map +1 -1
- package/dist/cjs/plain-object.cjs +2 -3
- package/dist/cjs/plain-object.cjs.map +1 -1
- package/dist/cjs/rimbu-error.cjs +5 -5
- package/dist/cjs/rimbu-error.cjs.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -18,30 +18,34 @@ For complete documentation please visit the _[Rimbu Docs](https://rimbu.org)_ or
|
|
|
18
18
|
|
|
19
19
|
### Compabitity
|
|
20
20
|
|
|
21
|
-
- [`Node
|
|
21
|
+
- [`Node` ](https://nodejs.org)
|
|
22
22
|
- [`Deno` ](https://deno.com/runtime)
|
|
23
|
-
- [`Bun
|
|
23
|
+
- [`Bun` ](https://bun.sh/)
|
|
24
24
|
- `Web` 
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### Package Managers
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
**Yarn:**
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
```sh
|
|
31
|
+
yarn add @rimbu/base
|
|
32
|
+
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
**npm:**
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
```sh
|
|
37
|
+
npm install @rimbu/base
|
|
38
|
+
```
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
**Bun:**
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
```sh
|
|
43
|
+
bun add @rimbu/base
|
|
44
|
+
```
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
### Deno Setup
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
Create or edit `import_map.json` in your project root:
|
|
45
49
|
|
|
46
50
|
```json
|
|
47
51
|
{
|
|
@@ -51,7 +55,7 @@ In the root folder of your project, create or edit a file called `import_map.jso
|
|
|
51
55
|
}
|
|
52
56
|
```
|
|
53
57
|
|
|
54
|
-
|
|
58
|
+
_Replace `x.y.z` with the desired version._
|
|
55
59
|
|
|
56
60
|
In this way you can use relative imports from Rimbu in your code, like so:
|
|
57
61
|
|
|
@@ -85,20 +89,18 @@ console.log(arr);
|
|
|
85
89
|
|
|
86
90
|
## Author
|
|
87
91
|
|
|
88
|
-
[Arvid Nicolaas](https://github.com/vitoke)
|
|
92
|
+
Created and maintained by [Arvid Nicolaas](https://github.com/vitoke).
|
|
89
93
|
|
|
90
94
|
## Contributing
|
|
91
95
|
|
|
92
|
-
|
|
96
|
+
We welcome contributions! Please read our [Contributing guide](https://github.com/rimbu-org/rimbu/blob/main/CONTRIBUTING.md).
|
|
93
97
|
|
|
94
98
|
## Contributors
|
|
95
99
|
|
|
96
100
|
<img src = "https://contrib.rocks/image?repo=rimbu-org/rimbu"/>
|
|
97
101
|
|
|
98
|
-
|
|
102
|
+
_Made with [contributors-img](https://contrib.rocks)._
|
|
99
103
|
|
|
100
104
|
## License
|
|
101
105
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
See [LICENSE](./LICENSE) for more information.
|
|
106
|
+
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) for details.
|
package/dist/cjs/arr.cjs
CHANGED
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.splice = exports.insert = exports.mod = exports.update = exports.last = exports.prepend = exports.reverse = exports.append = void 0;
|
|
4
|
+
exports._appendNew = _appendNew;
|
|
5
|
+
exports._appendOld = _appendOld;
|
|
6
|
+
exports.concat = concat;
|
|
7
|
+
exports._reverseNew = _reverseNew;
|
|
8
|
+
exports._reverseOld = _reverseOld;
|
|
9
|
+
exports.forEach = forEach;
|
|
10
|
+
exports.map = map;
|
|
11
|
+
exports.reverseMap = reverseMap;
|
|
12
|
+
exports._prependNew = _prependNew;
|
|
13
|
+
exports._prependOld = _prependOld;
|
|
14
|
+
exports._lastNew = _lastNew;
|
|
15
|
+
exports._lastOld = _lastOld;
|
|
16
|
+
exports._updateNew = _updateNew;
|
|
17
|
+
exports._updateOld = _updateOld;
|
|
18
|
+
exports._modNew = _modNew;
|
|
19
|
+
exports._modOld = _modOld;
|
|
20
|
+
exports._insertNew = _insertNew;
|
|
21
|
+
exports._insertOld = _insertOld;
|
|
22
|
+
exports.tail = tail;
|
|
23
|
+
exports.init = init;
|
|
24
|
+
exports._spliceNew = _spliceNew;
|
|
25
|
+
exports._spliceOld = _spliceOld;
|
|
26
|
+
exports.copySparse = copySparse;
|
|
27
|
+
exports.mapSparse = mapSparse;
|
|
4
28
|
var tslib_1 = require("tslib");
|
|
5
29
|
var common_1 = require("@rimbu/common");
|
|
6
30
|
function _appendNew(array, value) {
|
|
7
31
|
return array.toSpliced(array.length, 0, value);
|
|
8
32
|
}
|
|
9
|
-
exports._appendNew = _appendNew;
|
|
10
33
|
function _appendOld(array, value) {
|
|
11
34
|
var clone = array.slice();
|
|
12
35
|
clone.push(value);
|
|
13
36
|
return clone;
|
|
14
37
|
}
|
|
15
|
-
exports._appendOld = _appendOld;
|
|
16
38
|
// Returns a copy of the array with the given value appended
|
|
17
39
|
exports.append = "toSpliced" in Array.prototype ? _appendNew : _appendOld;
|
|
18
40
|
// Returns the concatenation of the two arrays, potentially reusing the input array if one of the arrays is empty
|
|
@@ -23,14 +45,12 @@ function concat(first, second) {
|
|
|
23
45
|
return first;
|
|
24
46
|
return first.concat(second);
|
|
25
47
|
}
|
|
26
|
-
exports.concat = concat;
|
|
27
48
|
function _reverseNew(array, start, end) {
|
|
28
49
|
var source = undefined !== start || undefined !== end
|
|
29
50
|
? array.slice(start !== null && start !== void 0 ? start : 0, (end !== null && end !== void 0 ? end : array.length - 1) + 1)
|
|
30
51
|
: array;
|
|
31
52
|
return source.toReversed();
|
|
32
53
|
}
|
|
33
|
-
exports._reverseNew = _reverseNew;
|
|
34
54
|
function _reverseOld(array, start, end) {
|
|
35
55
|
var _start = start !== null && start !== void 0 ? start : 0;
|
|
36
56
|
var _end = end !== null && end !== void 0 ? end : array.length - 1;
|
|
@@ -42,7 +62,6 @@ function _reverseOld(array, start, end) {
|
|
|
42
62
|
res[resIndex--] = array[arrayIndex];
|
|
43
63
|
return res;
|
|
44
64
|
}
|
|
45
|
-
exports._reverseOld = _reverseOld;
|
|
46
65
|
// Returns an copy of the array between the start and end indices, with the elements in reversed order.
|
|
47
66
|
exports.reverse = 'toReversed' in Array.prototype ? _reverseNew : _reverseOld;
|
|
48
67
|
// Performs given function on each element of the array, in reverse order if 'reversed' is true.
|
|
@@ -66,7 +85,6 @@ function forEach(array, f, state, reversed) {
|
|
|
66
85
|
}
|
|
67
86
|
}
|
|
68
87
|
}
|
|
69
|
-
exports.forEach = forEach;
|
|
70
88
|
// Returns a copy of the array where given function is applied to each element
|
|
71
89
|
function map(array, f, indexOffset) {
|
|
72
90
|
if (indexOffset === void 0) { indexOffset = 0; }
|
|
@@ -83,7 +101,6 @@ function map(array, f, indexOffset) {
|
|
|
83
101
|
}
|
|
84
102
|
return result;
|
|
85
103
|
}
|
|
86
|
-
exports.map = map;
|
|
87
104
|
// Returns a copy of the array where given functio is applied to each element in reverse order
|
|
88
105
|
function reverseMap(array, f, indexOffset) {
|
|
89
106
|
if (indexOffset === void 0) { indexOffset = 0; }
|
|
@@ -95,27 +112,22 @@ function reverseMap(array, f, indexOffset) {
|
|
|
95
112
|
result[resultIndex++] = f(array[arrayIndex], index++);
|
|
96
113
|
return result;
|
|
97
114
|
}
|
|
98
|
-
exports.reverseMap = reverseMap;
|
|
99
115
|
function _prependNew(array, value) {
|
|
100
116
|
return array.toSpliced(0, 0, value);
|
|
101
117
|
}
|
|
102
|
-
exports._prependNew = _prependNew;
|
|
103
118
|
function _prependOld(array, value) {
|
|
104
119
|
var clone = array.slice();
|
|
105
120
|
clone.unshift(value);
|
|
106
121
|
return clone;
|
|
107
122
|
}
|
|
108
|
-
exports._prependOld = _prependOld;
|
|
109
123
|
// Returns a copy of the given array with the given value added at the start
|
|
110
124
|
exports.prepend = "toSpliced" in Array.prototype ? _prependNew : _prependOld;
|
|
111
125
|
function _lastNew(arr) {
|
|
112
126
|
return arr.at(-1);
|
|
113
127
|
}
|
|
114
|
-
exports._lastNew = _lastNew;
|
|
115
128
|
function _lastOld(arr) {
|
|
116
129
|
return arr[arr.length - 1];
|
|
117
130
|
}
|
|
118
|
-
exports._lastOld = _lastOld;
|
|
119
131
|
// Returns the last element of the array
|
|
120
132
|
exports.last = "at" in Array.prototype ? _lastNew : _lastOld;
|
|
121
133
|
function _updateNew(arr, index, updater) {
|
|
@@ -129,7 +141,6 @@ function _updateNew(arr, index, updater) {
|
|
|
129
141
|
}
|
|
130
142
|
return arr.with(index, newValue);
|
|
131
143
|
}
|
|
132
|
-
exports._updateNew = _updateNew;
|
|
133
144
|
function _updateOld(arr, index, updater) {
|
|
134
145
|
if (index < 0 || index >= arr.length) {
|
|
135
146
|
return arr;
|
|
@@ -143,7 +154,6 @@ function _updateOld(arr, index, updater) {
|
|
|
143
154
|
newArr[index] = newValue;
|
|
144
155
|
return newArr;
|
|
145
156
|
}
|
|
146
|
-
exports._updateOld = _updateOld;
|
|
147
157
|
// Returns a copy of the array where the element at given index is replaced by the given updater.
|
|
148
158
|
// If the new element is the same as the old element, the original array is returned
|
|
149
159
|
exports.update = "with" in Array.prototype ? _updateNew : _updateOld;
|
|
@@ -158,7 +168,6 @@ function _modNew(arr, index, f) {
|
|
|
158
168
|
}
|
|
159
169
|
return arr.with(index, newValue);
|
|
160
170
|
}
|
|
161
|
-
exports._modNew = _modNew;
|
|
162
171
|
function _modOld(arr, index, f) {
|
|
163
172
|
if (index < 0 || index >= arr.length) {
|
|
164
173
|
return arr;
|
|
@@ -172,32 +181,27 @@ function _modOld(arr, index, f) {
|
|
|
172
181
|
newArr[index] = newValue;
|
|
173
182
|
return newArr;
|
|
174
183
|
}
|
|
175
|
-
exports._modOld = _modOld;
|
|
176
184
|
// Returns a copy of the array where the element at given index is replaced by applying given function.
|
|
177
185
|
// If the new element is the same as the old element, the original array is returned
|
|
178
186
|
exports.mod = "with" in Array.prototype ? _modNew : _modOld;
|
|
179
187
|
function _insertNew(arr, index, value) {
|
|
180
188
|
return arr.toSpliced(index, 0, value);
|
|
181
189
|
}
|
|
182
|
-
exports._insertNew = _insertNew;
|
|
183
190
|
function _insertOld(arr, index, value) {
|
|
184
191
|
var clone = arr.slice();
|
|
185
192
|
clone.splice(index, 0, value);
|
|
186
193
|
return clone;
|
|
187
194
|
}
|
|
188
|
-
exports._insertOld = _insertOld;
|
|
189
195
|
// Returns a copy of the array where at given index the given value is inserted
|
|
190
196
|
exports.insert = "toSpliced" in Array.prototype ? _insertNew : _insertOld;
|
|
191
197
|
// Returns a copy of the array, without its first element
|
|
192
198
|
function tail(arr) {
|
|
193
199
|
return arr.slice(1);
|
|
194
200
|
}
|
|
195
|
-
exports.tail = tail;
|
|
196
201
|
// Returns a copy of the array, without its last element
|
|
197
202
|
function init(arr) {
|
|
198
203
|
return arr.slice(0, arr.length - 1);
|
|
199
204
|
}
|
|
200
|
-
exports.init = init;
|
|
201
205
|
function _spliceNew(arr, start, deleteCount) {
|
|
202
206
|
var items = [];
|
|
203
207
|
for (var _i = 3; _i < arguments.length; _i++) {
|
|
@@ -205,7 +209,6 @@ function _spliceNew(arr, start, deleteCount) {
|
|
|
205
209
|
}
|
|
206
210
|
return arr.toSpliced.apply(arr, tslib_1.__spreadArray([start, deleteCount], tslib_1.__read(items), false));
|
|
207
211
|
}
|
|
208
|
-
exports._spliceNew = _spliceNew;
|
|
209
212
|
function _spliceOld(arr, start, deleteCount) {
|
|
210
213
|
var items = [];
|
|
211
214
|
for (var _i = 3; _i < arguments.length; _i++) {
|
|
@@ -215,7 +218,6 @@ function _spliceOld(arr, start, deleteCount) {
|
|
|
215
218
|
clone.splice.apply(clone, tslib_1.__spreadArray([start, deleteCount], tslib_1.__read(items), false));
|
|
216
219
|
return clone;
|
|
217
220
|
}
|
|
218
|
-
exports._spliceOld = _spliceOld;
|
|
219
221
|
// Immutable version of the array .splice command, always returns a new array
|
|
220
222
|
exports.splice = "toSpliced" in Array.prototype ? _spliceNew : _spliceOld;
|
|
221
223
|
// Returns a copy of the array, where its 'sparse' property is kept (sparse = not all indices have a value)
|
|
@@ -226,7 +228,6 @@ function copySparse(arr) {
|
|
|
226
228
|
}
|
|
227
229
|
return clone;
|
|
228
230
|
}
|
|
229
|
-
exports.copySparse = copySparse;
|
|
230
231
|
// Returns a copy of the array with given function applied to each element, where its 'sparse' property is kept
|
|
231
232
|
// (sparse = not all indices have a value)
|
|
232
233
|
function mapSparse(arr, f) {
|
|
@@ -236,5 +237,4 @@ function mapSparse(arr, f) {
|
|
|
236
237
|
}
|
|
237
238
|
return result;
|
|
238
239
|
}
|
|
239
|
-
exports.mapSparse = mapSparse;
|
|
240
240
|
//# sourceMappingURL=arr.cjs.map
|
package/dist/cjs/arr.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arr.cjs","sourceRoot":"","sources":["../../_cjs_prepare/arr.cts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arr.cjs","sourceRoot":"","sources":["../../_cjs_prepare/arr.cts"],"names":[],"mappings":";;;AAEA,gCAEC;AAED,gCAIC;AAMD,wBAOC;AAED,kCAWC;AAED,kCAgBC;AAOD,0BAwBC;AAGD,kBAmBC;AAGD,gCAcC;AAED,kCAKC;AAED,kCAOC;AAMD,4BAEC;AAED,4BAEC;AAKD,gCAgBC;AAED,gCAkBC;AAMD,0BAiBC;AAED,0BAmBC;AAMD,gCAEC;AAED,gCAIC;AAMD,oBAEC;AAGD,oBAEC;AAED,gCAOC;AAED,gCASC;AAMD,gCAMC;AAID,8BAWC;;AAvTD,wCAA0E;AAE1E,S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,CAAC,GAAG,CAAC,EAAE,GAAU,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/cjs/entry.cjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.first = first;
|
|
4
|
+
exports.second = second;
|
|
4
5
|
// Returns the first element of a 2-Tuple
|
|
5
6
|
function first(entry) {
|
|
6
7
|
return entry[0];
|
|
7
8
|
}
|
|
8
|
-
exports.first = first;
|
|
9
9
|
// Returns the second element of a 2-Tuple
|
|
10
10
|
function second(entry) {
|
|
11
11
|
return entry[1];
|
|
12
12
|
}
|
|
13
|
-
exports.second = second;
|
|
14
13
|
//# sourceMappingURL=entry.cjs.map
|
package/dist/cjs/entry.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.cjs","sourceRoot":"","sources":["../../_cjs_prepare/entry.cts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entry.cjs","sourceRoot":"","sources":["../../_cjs_prepare/entry.cts"],"names":[],"mappings":";;AACA,sBAEC;AAGD,wBAEC;AARD,yCAAyC;AACzC,SAAgB,KAAK,CAAO,KAAsB;IAChD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,0CAA0C;AAC1C,SAAgB,MAAM,CAAO,KAAsB;IACjD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isPlainObj = isPlainObj;
|
|
4
|
+
exports.isIterable = isIterable;
|
|
4
5
|
/**
|
|
5
6
|
* Companion function to the `IsRecord<T>` type that checks whether the given object is a pure
|
|
6
7
|
* data object.
|
|
@@ -15,7 +16,6 @@ function isPlainObj(obj) {
|
|
|
15
16
|
!(Symbol.iterator in obj) &&
|
|
16
17
|
!(Symbol.asyncIterator in obj));
|
|
17
18
|
}
|
|
18
|
-
exports.isPlainObj = isPlainObj;
|
|
19
19
|
/**
|
|
20
20
|
* Returns true if the given object is Iterable
|
|
21
21
|
* @param obj - the object to check
|
|
@@ -23,5 +23,4 @@ exports.isPlainObj = isPlainObj;
|
|
|
23
23
|
function isIterable(obj) {
|
|
24
24
|
return obj !== null && typeof obj === 'object' && Symbol.iterator in obj;
|
|
25
25
|
}
|
|
26
|
-
exports.isIterable = isIterable;
|
|
27
26
|
//# sourceMappingURL=plain-object.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plain-object.cjs","sourceRoot":"","sources":["../../_cjs_prepare/plain-object.cts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plain-object.cjs","sourceRoot":"","sources":["../../_cjs_prepare/plain-object.cts"],"names":[],"mappings":";;AA8EA,gCAQC;AAMD,gCAEC;AAvBD;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,GAAQ;IACjC,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,IAAI,KAAK,GAAG;QACZ,CAAC,GAAG,CAAC,WAAW,KAAK,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,YAAY,QAAQ,CAAC,CAAC;QACtE,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAC;QACzB,CAAC,CAAC,MAAM,CAAC,aAAa,IAAI,GAAG,CAAC,CAC/B,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,GAAQ;IACjC,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAC;AAC3E,CAAC"}
|
package/dist/cjs/rimbu-error.cjs
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.InvalidUsageError = exports.InvalidStateError = exports.ModifiedBuilderWhileLoopingOverItError = exports.EmptyCollectionAssumedNonEmptyError = void 0;
|
|
4
|
+
exports.throwEmptyCollectionAssumedNonEmptyError = throwEmptyCollectionAssumedNonEmptyError;
|
|
5
|
+
exports.throwModifiedBuilderWhileLoopingOverItError = throwModifiedBuilderWhileLoopingOverItError;
|
|
6
|
+
exports.throwInvalidStateError = throwInvalidStateError;
|
|
7
|
+
exports.throwInvalidUsageError = throwInvalidUsageError;
|
|
4
8
|
var tslib_1 = require("tslib");
|
|
5
9
|
var common_1 = require("@rimbu/common");
|
|
6
10
|
var EmptyCollectionAssumedNonEmptyError = /** @class */ (function (_super) {
|
|
@@ -38,17 +42,13 @@ exports.InvalidUsageError = InvalidUsageError;
|
|
|
38
42
|
function throwEmptyCollectionAssumedNonEmptyError() {
|
|
39
43
|
throw new EmptyCollectionAssumedNonEmptyError();
|
|
40
44
|
}
|
|
41
|
-
exports.throwEmptyCollectionAssumedNonEmptyError = throwEmptyCollectionAssumedNonEmptyError;
|
|
42
45
|
function throwModifiedBuilderWhileLoopingOverItError() {
|
|
43
46
|
throw new ModifiedBuilderWhileLoopingOverItError();
|
|
44
47
|
}
|
|
45
|
-
exports.throwModifiedBuilderWhileLoopingOverItError = throwModifiedBuilderWhileLoopingOverItError;
|
|
46
48
|
function throwInvalidStateError() {
|
|
47
49
|
throw new InvalidStateError();
|
|
48
50
|
}
|
|
49
|
-
exports.throwInvalidStateError = throwInvalidStateError;
|
|
50
51
|
function throwInvalidUsageError(msg) {
|
|
51
52
|
throw new InvalidUsageError(msg);
|
|
52
53
|
}
|
|
53
|
-
exports.throwInvalidUsageError = throwInvalidUsageError;
|
|
54
54
|
//# sourceMappingURL=rimbu-error.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rimbu-error.cjs","sourceRoot":"","sources":["../../_cjs_prepare/rimbu-error.cts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rimbu-error.cjs","sourceRoot":"","sources":["../../_cjs_prepare/rimbu-error.cts"],"names":[],"mappings":";;;AAwBA,4FAEC;AAED,kGAEC;AAED,wDAEC;AAED,wDAEC;;AAtCD,wCAAwC;AAExC;IAAyD,+DAAmB;IAC1E;QACE,OAAA,MAAK,YAAC,+CAA+C,CAAC,SAAC;IACzD,CAAC;IACH,0CAAC;AAAD,CAAC,AAJD,CAAyD,gBAAO,CAAC,WAAW,GAI3E;AAJY,kFAAmC;AAMhD;IAA4D,kEAAmB;IAC7E;QACE,OAAA,MAAK,YAAC,+DAA+D,CAAC,SAAC;IACzE,CAAC;IACH,6CAAC;AAAD,CAAC,AAJD,CAA4D,gBAAO,CAAC,WAAW,GAI9E;AAJY,wFAAsC;AAMnD;IAAuC,6CAAmB;IACxD;QACE,OAAA,MAAK,YACH,4EAA4E,CAC7E,SAAC;IACJ,CAAC;IACH,wBAAC;AAAD,CAAC,AAND,CAAuC,gBAAO,CAAC,WAAW,GAMzD;AANY,8CAAiB;AAQ9B;IAAuC,6CAAmB;IAA1D;;IAA4D,CAAC;IAAD,wBAAC;AAAD,CAAC,AAA7D,CAAuC,gBAAO,CAAC,WAAW,GAAG;AAAhD,8CAAiB;AAE9B,SAAgB,wCAAwC;IACtD,MAAM,IAAI,mCAAmC,EAAE,CAAC;AAClD,CAAC;AAED,SAAgB,2CAA2C;IACzD,MAAM,IAAI,sCAAsC,EAAE,CAAC;AACrD,CAAC;AAED,SAAgB,sBAAsB;IACpC,MAAM,IAAI,iBAAiB,EAAE,CAAC;AAChC,CAAC;AAED,SAAgB,sBAAsB,CAAC,GAAW;IAChD,MAAM,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimbu/base",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Utilities to implement Rimbu collections",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"types": "./dist/cjs/index.d.cts",
|
|
33
33
|
"exports": {
|
|
34
34
|
".": {
|
|
35
|
+
"bun": "./dist/bun/main/index.mts",
|
|
35
36
|
"import": {
|
|
36
37
|
"types": "./dist/esm/index.d.mts",
|
|
37
38
|
"default": "./dist/esm/index.mjs"
|
|
@@ -39,8 +40,7 @@
|
|
|
39
40
|
"require": {
|
|
40
41
|
"types": "./dist/cjs/index.d.cts",
|
|
41
42
|
"default": "./dist/cjs/index.cjs"
|
|
42
|
-
}
|
|
43
|
-
"bun": "./dist/bun/main/index.mts"
|
|
43
|
+
}
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"typecheck": "tsc"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@rimbu/common": "^2.0.
|
|
76
|
+
"@rimbu/common": "^2.0.2"
|
|
77
77
|
},
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "f18ddf964507dbd10790da3cd4deef8f455a178e"
|
|
82
82
|
}
|