@rimbu/base 2.0.0 → 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 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 >= 16` ![NodeJS](https://img.shields.io/badge/node.js-6DA55F?logo=node.js&logoColor=white)](https://nodejs.org)
21
+ - [`Node` ![NodeJS](https://img.shields.io/badge/node.js-6DA55F?logo=node.js&logoColor=white)](https://nodejs.org)
22
22
  - [`Deno` ![Deno JS](https://img.shields.io/badge/deno%20js-000000?logo=deno&logoColor=white)](https://deno.com/runtime)
23
- - [`Bun >= 0.6.0` ![Bun](https://img.shields.io/badge/Bun-%23000000.svg?logoColor=white)](https://bun.sh/)
23
+ - [`Bun` ![Bun](https://img.shields.io/badge/Bun-%23000000.svg?logoColor=white)](https://bun.sh/)
24
24
  - `Web` ![HTML5](https://img.shields.io/badge/html5-%23E34F26.svg?logoColor=white)
25
25
 
26
- ### Yarn / NPM / Bun
26
+ ### Package Managers
27
27
 
28
- For `yarn`:
28
+ **Yarn:**
29
29
 
30
- > `yarn add @rimbu/base`
31
-
32
- For `npm`:
30
+ ```sh
31
+ yarn add @rimbu/base
32
+ ```
33
33
 
34
- > `npm i @rimbu/base`
34
+ **npm:**
35
35
 
36
- For `bun`:
36
+ ```sh
37
+ npm install @rimbu/base
38
+ ```
37
39
 
38
- > `bun add @rimbu/base`
40
+ **Bun:**
39
41
 
40
- ### Deno
42
+ ```sh
43
+ bun add @rimbu/base
44
+ ```
41
45
 
42
- For Deno, the following approach is recommended:
46
+ ### Deno Setup
43
47
 
44
- In the root folder of your project, create or edit a file called `import_map.json` with the following contents (where you should replace `x.y.z` with the desired version of Rimbu):
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
- **Note: The trailing slashes are important!**
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
- Feel very welcome to contribute to further improve Rimbu. Please read our [Contributing guide](https://github.com/rimbu-org/rimbu/blob/main/CONTRIBUTING.md).
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
- Made with [contributors-img](https://contrib.rocks).
102
+ _Made with [contributors-img](https://contrib.rocks)._
99
103
 
100
104
  ## License
101
105
 
102
- Licensed under the MIT License, Copyright © 2020-present Arvid Nicolaas.
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,267 +1,240 @@
1
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
- _appendNew: () => _appendNew,
24
- _appendOld: () => _appendOld,
25
- _insertNew: () => _insertNew,
26
- _insertOld: () => _insertOld,
27
- _lastNew: () => _lastNew,
28
- _lastOld: () => _lastOld,
29
- _modNew: () => _modNew,
30
- _modOld: () => _modOld,
31
- _prependNew: () => _prependNew,
32
- _prependOld: () => _prependOld,
33
- _reverseNew: () => _reverseNew,
34
- _reverseOld: () => _reverseOld,
35
- _spliceNew: () => _spliceNew,
36
- _spliceOld: () => _spliceOld,
37
- _updateNew: () => _updateNew,
38
- _updateOld: () => _updateOld,
39
- append: () => append,
40
- concat: () => concat,
41
- copySparse: () => copySparse,
42
- forEach: () => forEach,
43
- init: () => init,
44
- insert: () => insert,
45
- last: () => last,
46
- map: () => map,
47
- mapSparse: () => mapSparse,
48
- mod: () => mod,
49
- prepend: () => prepend,
50
- reverse: () => reverse,
51
- reverseMap: () => reverseMap,
52
- splice: () => splice,
53
- tail: () => tail,
54
- update: () => update
55
- });
56
- module.exports = __toCommonJS(arr_exports);
57
- var import_common = require("@rimbu/common");
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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;
28
+ var tslib_1 = require("tslib");
29
+ var common_1 = require("@rimbu/common");
58
30
  function _appendNew(array, value) {
59
- return array.toSpliced(array.length, 0, value);
31
+ return array.toSpliced(array.length, 0, value);
60
32
  }
61
33
  function _appendOld(array, value) {
62
- const clone = array.slice();
63
- clone.push(value);
64
- return clone;
34
+ var clone = array.slice();
35
+ clone.push(value);
36
+ return clone;
65
37
  }
66
- var append = `toSpliced` in Array.prototype ? _appendNew : _appendOld;
38
+ // Returns a copy of the array with the given value appended
39
+ exports.append = "toSpliced" in Array.prototype ? _appendNew : _appendOld;
40
+ // Returns the concatenation of the two arrays, potentially reusing the input array if one of the arrays is empty
67
41
  function concat(first, second) {
68
- if (first.length === 0)
69
- return second;
70
- if (second.length === 0)
71
- return first;
72
- return first.concat(second);
42
+ if (first.length === 0)
43
+ return second;
44
+ if (second.length === 0)
45
+ return first;
46
+ return first.concat(second);
73
47
  }
74
48
  function _reverseNew(array, start, end) {
75
- const source = void 0 !== start || void 0 !== end ? array.slice(start ?? 0, (end ?? array.length - 1) + 1) : array;
76
- return source.toReversed();
49
+ var source = undefined !== start || undefined !== end
50
+ ? array.slice(start !== null && start !== void 0 ? start : 0, (end !== null && end !== void 0 ? end : array.length - 1) + 1)
51
+ : array;
52
+ return source.toReversed();
77
53
  }
78
54
  function _reverseOld(array, start, end) {
79
- const _start = start ?? 0;
80
- const _end = end ?? array.length - 1;
81
- const length = _end - _start + 1;
82
- const res = [];
83
- let arrayIndex = _start - 1;
84
- let resIndex = length - 1;
85
- while (++arrayIndex <= _end)
86
- res[resIndex--] = array[arrayIndex];
87
- return res;
88
- }
89
- var reverse = "toReversed" in Array.prototype ? _reverseNew : _reverseOld;
90
- function forEach(array, f, state = (0, import_common.TraverseState)(), reversed = false) {
91
- if (state.halted)
92
- return;
93
- const { halt } = state;
94
- if (reversed) {
95
- let i = array.length;
96
- while (!state.halted && --i >= 0) {
97
- f(array[i], state.nextIndex(), halt);
55
+ var _start = start !== null && start !== void 0 ? start : 0;
56
+ var _end = end !== null && end !== void 0 ? end : array.length - 1;
57
+ var length = _end - _start + 1;
58
+ var res = [];
59
+ var arrayIndex = _start - 1;
60
+ var resIndex = length - 1;
61
+ while (++arrayIndex <= _end)
62
+ res[resIndex--] = array[arrayIndex];
63
+ return res;
64
+ }
65
+ // Returns an copy of the array between the start and end indices, with the elements in reversed order.
66
+ exports.reverse = 'toReversed' in Array.prototype ? _reverseNew : _reverseOld;
67
+ // Performs given function on each element of the array, in reverse order if 'reversed' is true.
68
+ function forEach(array, f, state, reversed) {
69
+ if (state === void 0) { state = (0, common_1.TraverseState)(); }
70
+ if (reversed === void 0) { reversed = false; }
71
+ if (state.halted)
72
+ return;
73
+ var halt = state.halt;
74
+ if (reversed) {
75
+ var i = array.length;
76
+ while (!state.halted && --i >= 0) {
77
+ f(array[i], state.nextIndex(), halt);
78
+ }
98
79
  }
99
- } else {
100
- const length = array.length;
101
- let i = -1;
102
- while (!state.halted && ++i < length) {
103
- f(array[i], state.nextIndex(), halt);
80
+ else {
81
+ var length = array.length;
82
+ var i = -1;
83
+ while (!state.halted && ++i < length) {
84
+ f(array[i], state.nextIndex(), halt);
85
+ }
104
86
  }
105
- }
106
- }
107
- function map(array, f, indexOffset = 0) {
108
- if (indexOffset === 0) {
109
- return array.map(f);
110
- }
111
- const result = [];
112
- let index = indexOffset;
113
- let i = -1;
114
- const length = array.length;
115
- while (++i < length) {
116
- result[i] = f(array[i], index++);
117
- }
118
- return result;
119
87
  }
120
- function reverseMap(array, f, indexOffset = 0) {
121
- const result = [];
122
- let index = indexOffset;
123
- let arrayIndex = array.length;
124
- let resultIndex = 0;
125
- while (--arrayIndex >= 0)
126
- result[resultIndex++] = f(array[arrayIndex], index++);
127
- return result;
88
+ // Returns a copy of the array where given function is applied to each element
89
+ function map(array, f, indexOffset) {
90
+ if (indexOffset === void 0) { indexOffset = 0; }
91
+ if (indexOffset === 0) {
92
+ // without offset, can use standard array map
93
+ return array.map(f);
94
+ }
95
+ var result = [];
96
+ var index = indexOffset;
97
+ var i = -1;
98
+ var length = array.length;
99
+ while (++i < length) {
100
+ result[i] = f(array[i], index++);
101
+ }
102
+ return result;
103
+ }
104
+ // Returns a copy of the array where given functio is applied to each element in reverse order
105
+ function reverseMap(array, f, indexOffset) {
106
+ if (indexOffset === void 0) { indexOffset = 0; }
107
+ var result = [];
108
+ var index = indexOffset;
109
+ var arrayIndex = array.length;
110
+ var resultIndex = 0;
111
+ while (--arrayIndex >= 0)
112
+ result[resultIndex++] = f(array[arrayIndex], index++);
113
+ return result;
128
114
  }
129
115
  function _prependNew(array, value) {
130
- return array.toSpliced(0, 0, value);
116
+ return array.toSpliced(0, 0, value);
131
117
  }
132
118
  function _prependOld(array, value) {
133
- const clone = array.slice();
134
- clone.unshift(value);
135
- return clone;
119
+ var clone = array.slice();
120
+ clone.unshift(value);
121
+ return clone;
136
122
  }
137
- var prepend = `toSpliced` in Array.prototype ? _prependNew : _prependOld;
123
+ // Returns a copy of the given array with the given value added at the start
124
+ exports.prepend = "toSpliced" in Array.prototype ? _prependNew : _prependOld;
138
125
  function _lastNew(arr) {
139
- return arr.at(-1);
126
+ return arr.at(-1);
140
127
  }
141
128
  function _lastOld(arr) {
142
- return arr[arr.length - 1];
129
+ return arr[arr.length - 1];
143
130
  }
144
- var last = `at` in Array.prototype ? _lastNew : _lastOld;
131
+ // Returns the last element of the array
132
+ exports.last = "at" in Array.prototype ? _lastNew : _lastOld;
145
133
  function _updateNew(arr, index, updater) {
146
- if (index < 0 || index >= arr.length) {
147
- return arr;
148
- }
149
- const curValue = arr[index];
150
- const newValue = (0, import_common.Update)(curValue, updater);
151
- if (Object.is(newValue, curValue)) {
152
- return arr;
153
- }
154
- return arr.with(index, newValue);
134
+ if (index < 0 || index >= arr.length) {
135
+ return arr;
136
+ }
137
+ var curValue = arr[index];
138
+ var newValue = (0, common_1.Update)(curValue, updater);
139
+ if (Object.is(newValue, curValue)) {
140
+ return arr;
141
+ }
142
+ return arr.with(index, newValue);
155
143
  }
156
144
  function _updateOld(arr, index, updater) {
157
- if (index < 0 || index >= arr.length) {
158
- return arr;
159
- }
160
- const curValue = arr[index];
161
- const newValue = (0, import_common.Update)(curValue, updater);
162
- if (Object.is(newValue, curValue)) {
163
- return arr;
164
- }
165
- const newArr = arr.slice();
166
- newArr[index] = newValue;
167
- return newArr;
145
+ if (index < 0 || index >= arr.length) {
146
+ return arr;
147
+ }
148
+ var curValue = arr[index];
149
+ var newValue = (0, common_1.Update)(curValue, updater);
150
+ if (Object.is(newValue, curValue)) {
151
+ return arr;
152
+ }
153
+ var newArr = arr.slice();
154
+ newArr[index] = newValue;
155
+ return newArr;
168
156
  }
169
- var update = `with` in Array.prototype ? _updateNew : _updateOld;
157
+ // Returns a copy of the array where the element at given index is replaced by the given updater.
158
+ // If the new element is the same as the old element, the original array is returned
159
+ exports.update = "with" in Array.prototype ? _updateNew : _updateOld;
170
160
  function _modNew(arr, index, f) {
171
- if (index < 0 || index >= arr.length) {
172
- return arr;
173
- }
174
- const curValue = arr[index];
175
- const newValue = f(curValue);
176
- if (Object.is(newValue, curValue)) {
177
- return arr;
178
- }
179
- return arr.with(index, newValue);
161
+ if (index < 0 || index >= arr.length) {
162
+ return arr;
163
+ }
164
+ var curValue = arr[index];
165
+ var newValue = f(curValue);
166
+ if (Object.is(newValue, curValue)) {
167
+ return arr;
168
+ }
169
+ return arr.with(index, newValue);
180
170
  }
181
171
  function _modOld(arr, index, f) {
182
- if (index < 0 || index >= arr.length) {
183
- return arr;
184
- }
185
- const curValue = arr[index];
186
- const newValue = f(curValue);
187
- if (Object.is(newValue, curValue)) {
188
- return arr;
189
- }
190
- const newArr = arr.slice();
191
- newArr[index] = newValue;
192
- return newArr;
172
+ if (index < 0 || index >= arr.length) {
173
+ return arr;
174
+ }
175
+ var curValue = arr[index];
176
+ var newValue = f(curValue);
177
+ if (Object.is(newValue, curValue)) {
178
+ return arr;
179
+ }
180
+ var newArr = arr.slice();
181
+ newArr[index] = newValue;
182
+ return newArr;
193
183
  }
194
- var mod = `with` in Array.prototype ? _modNew : _modOld;
184
+ // Returns a copy of the array where the element at given index is replaced by applying given function.
185
+ // If the new element is the same as the old element, the original array is returned
186
+ exports.mod = "with" in Array.prototype ? _modNew : _modOld;
195
187
  function _insertNew(arr, index, value) {
196
- return arr.toSpliced(index, 0, value);
188
+ return arr.toSpliced(index, 0, value);
197
189
  }
198
190
  function _insertOld(arr, index, value) {
199
- const clone = arr.slice();
200
- clone.splice(index, 0, value);
201
- return clone;
191
+ var clone = arr.slice();
192
+ clone.splice(index, 0, value);
193
+ return clone;
202
194
  }
203
- var insert = `toSpliced` in Array.prototype ? _insertNew : _insertOld;
195
+ // Returns a copy of the array where at given index the given value is inserted
196
+ exports.insert = "toSpliced" in Array.prototype ? _insertNew : _insertOld;
197
+ // Returns a copy of the array, without its first element
204
198
  function tail(arr) {
205
- return arr.slice(1);
199
+ return arr.slice(1);
206
200
  }
201
+ // Returns a copy of the array, without its last element
207
202
  function init(arr) {
208
- return arr.slice(0, arr.length - 1);
203
+ return arr.slice(0, arr.length - 1);
209
204
  }
210
- function _spliceNew(arr, start, deleteCount, ...items) {
211
- return arr.toSpliced(start, deleteCount, ...items);
205
+ function _spliceNew(arr, start, deleteCount) {
206
+ var items = [];
207
+ for (var _i = 3; _i < arguments.length; _i++) {
208
+ items[_i - 3] = arguments[_i];
209
+ }
210
+ return arr.toSpliced.apply(arr, tslib_1.__spreadArray([start, deleteCount], tslib_1.__read(items), false));
212
211
  }
213
- function _spliceOld(arr, start, deleteCount, ...items) {
214
- const clone = arr.slice();
215
- clone.splice(start, deleteCount, ...items);
216
- return clone;
212
+ function _spliceOld(arr, start, deleteCount) {
213
+ var items = [];
214
+ for (var _i = 3; _i < arguments.length; _i++) {
215
+ items[_i - 3] = arguments[_i];
216
+ }
217
+ var clone = arr.slice();
218
+ clone.splice.apply(clone, tslib_1.__spreadArray([start, deleteCount], tslib_1.__read(items), false));
219
+ return clone;
217
220
  }
218
- var splice = `toSpliced` in Array.prototype ? _spliceNew : _spliceOld;
221
+ // Immutable version of the array .splice command, always returns a new array
222
+ exports.splice = "toSpliced" in Array.prototype ? _spliceNew : _spliceOld;
223
+ // Returns a copy of the array, where its 'sparse' property is kept (sparse = not all indices have a value)
219
224
  function copySparse(arr) {
220
- const clone = [];
221
- for (const key in arr) {
222
- clone[key] = arr[key];
223
- }
224
- return clone;
225
+ var clone = [];
226
+ for (var key in arr) {
227
+ clone[key] = arr[key];
228
+ }
229
+ return clone;
225
230
  }
231
+ // Returns a copy of the array with given function applied to each element, where its 'sparse' property is kept
232
+ // (sparse = not all indices have a value)
226
233
  function mapSparse(arr, f) {
227
- const result = Array(arr.length);
228
- for (const key in arr) {
229
- result[key] = f(arr[key], key);
230
- }
231
- return result;
234
+ var result = Array(arr.length);
235
+ for (var key in arr) {
236
+ result[key] = f(arr[key], key);
237
+ }
238
+ return result;
232
239
  }
233
- // Annotate the CommonJS export names for ESM import in node:
234
- 0 && (module.exports = {
235
- _appendNew,
236
- _appendOld,
237
- _insertNew,
238
- _insertOld,
239
- _lastNew,
240
- _lastOld,
241
- _modNew,
242
- _modOld,
243
- _prependNew,
244
- _prependOld,
245
- _reverseNew,
246
- _reverseOld,
247
- _spliceNew,
248
- _spliceOld,
249
- _updateNew,
250
- _updateOld,
251
- append,
252
- concat,
253
- copySparse,
254
- forEach,
255
- init,
256
- insert,
257
- last,
258
- map,
259
- mapSparse,
260
- mod,
261
- prepend,
262
- reverse,
263
- reverseMap,
264
- splice,
265
- tail,
266
- update
267
- });
240
+ //# sourceMappingURL=arr.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arr.cjs","sourceRoot":"","sources":["../../_cjs_prepare/arr.cts"],"names":[],"mappings":";;;AAEA,gCAEC;AAED,gCAIC;AAMD,wBAOC;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,CAAC;IACxB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,+GAA+G;AAC/G,0CAA0C;AAC1C,SAAgB,SAAS,CACvB,GAAiB,EACjB,CAAkC;IAElC,IAAM,MAAM,GAAS,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAEvC,KAAK,IAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAU,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,37 +1,13 @@
1
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);
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.first = first;
4
+ exports.second = second;
5
+ // Returns the first element of a 2-Tuple
27
6
  function first(entry) {
28
- return entry[0];
7
+ return entry[0];
29
8
  }
9
+ // Returns the second element of a 2-Tuple
30
10
  function second(entry) {
31
- return entry[1];
11
+ return entry[1];
32
12
  }
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- first,
36
- second
37
- });
13
+ //# sourceMappingURL=entry.cjs.map
@@ -0,0 +1 @@
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"}