@bodil/core 0.5.9 → 0.6.1
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/dist/assert.js +0 -2
- package/dist/assert.js.map +1 -1
- package/dist/assert.test.js +2 -2
- package/dist/assert.test.js.map +1 -1
- package/dist/async/abortable-promise.js +12 -9
- package/dist/async/abortable-promise.js.map +1 -1
- package/dist/async/abortable-promise.test.js +10 -1
- package/dist/async/abortable-promise.test.js.map +1 -1
- package/dist/async/emitter.js +2 -2
- package/dist/async/emitter.js.map +1 -1
- package/dist/async/emitter.test.js +2 -3
- package/dist/async/emitter.test.js.map +1 -1
- package/dist/async.d.ts +2 -2
- package/dist/async.js +3 -4
- package/dist/async.js.map +1 -1
- package/dist/collections/lfu-cache.js +3 -3
- package/dist/collections/lfu-cache.js.map +1 -1
- package/dist/collections/lfu-cache.test.d.ts +1 -1
- package/dist/collections/lfu-cache.test.js +12 -12
- package/dist/collections/lfu-cache.test.js.map +1 -1
- package/dist/collections/linked-list.js +1 -1
- package/dist/collections/linked-list.js.map +1 -1
- package/dist/collections/lru-cache.js +3 -3
- package/dist/collections/lru-cache.js.map +1 -1
- package/dist/collections/lru-cache.test.d.ts +1 -1
- package/dist/collections/lru-cache.test.js +10 -10
- package/dist/collections/lru-cache.test.js.map +1 -1
- package/dist/collections.d.ts +3 -3
- package/dist/collections.js +3 -3
- package/dist/collections.js.map +1 -1
- package/dist/decorators.test.js +1 -1
- package/dist/decorators.test.js.map +1 -1
- package/dist/disposable.d.ts +1 -1
- package/dist/disposable.js +1 -1
- package/dist/disposable.js.map +1 -1
- package/dist/disposable.test.js +1 -1
- package/dist/disposable.test.js.map +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/order.test.d.ts +1 -1
- package/dist/order.test.js +11 -11
- package/dist/order.test.js.map +1 -1
- package/dist/time.js +2 -2
- package/dist/time.js.map +1 -1
- package/dist/time.test.js +1 -1
- package/dist/time.test.js.map +1 -1
- package/package.json +18 -39
- package/src/assert.test.ts +3 -3
- package/src/assert.ts +2 -6
- package/src/async/abortable-promise.test.ts +14 -1
- package/src/async/abortable-promise.ts +13 -9
- package/src/async/emitter.test.ts +2 -3
- package/src/async/emitter.ts +2 -2
- package/src/async.ts +3 -4
- package/src/collections/lfu-cache.test.ts +12 -13
- package/src/collections/lfu-cache.ts +3 -3
- package/src/collections/linked-list.ts +1 -1
- package/src/collections/lru-cache.test.ts +10 -11
- package/src/collections/lru-cache.ts +3 -3
- package/src/collections.ts +3 -3
- package/src/decorators.test.ts +1 -1
- package/src/disposable.test.ts +1 -1
- package/src/disposable.ts +1 -1
- package/src/index.ts +10 -10
- package/src/order.test.ts +11 -12
- package/src/time.test.ts +1 -1
- package/src/time.ts +2 -2
package/src/index.ts
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* @module
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import * as assert from "./assert";
|
|
7
|
-
import * as async from "./async";
|
|
8
|
-
import * as collections from "./collections";
|
|
9
|
-
import * as decorators from "./decorators";
|
|
10
|
-
import * as disposable from "./disposable";
|
|
11
|
-
import * as fun from "./fun";
|
|
12
|
-
import * as logger from "./logger";
|
|
13
|
-
import * as order from "./order";
|
|
14
|
-
import * as time from "./time";
|
|
15
|
-
import * as types from "./types";
|
|
6
|
+
import * as assert from "./assert.js";
|
|
7
|
+
import * as async from "./async.js";
|
|
8
|
+
import * as collections from "./collections.js";
|
|
9
|
+
import * as decorators from "./decorators.js";
|
|
10
|
+
import * as disposable from "./disposable.js";
|
|
11
|
+
import * as fun from "./fun.js";
|
|
12
|
+
import * as logger from "./logger.js";
|
|
13
|
+
import * as order from "./order.js";
|
|
14
|
+
import * as time from "./time.js";
|
|
15
|
+
import * as types from "./types.js";
|
|
16
16
|
|
|
17
17
|
export { assert, async, collections, decorators, disposable, fun, logger, order, time, types };
|
package/src/order.test.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { None, Some } from "@bodil/opt";
|
|
1
2
|
import { expect, test } from "vitest";
|
|
2
3
|
|
|
3
|
-
import * as Order from "./order";
|
|
4
|
-
|
|
5
|
-
import "@bodil/opt-vitest";
|
|
4
|
+
import * as Order from "./order.js";
|
|
6
5
|
|
|
7
6
|
const bisectLowNum = (array: Array<number>, key: number) =>
|
|
8
7
|
Order.bisectLow(Order.ascending, array, key);
|
|
@@ -69,17 +68,17 @@ test("find", () => {
|
|
|
69
68
|
const list: Array<FindTestData> = [e0, e1, e2, e3];
|
|
70
69
|
|
|
71
70
|
// Entries not in the list
|
|
72
|
-
expect(findE(list, { foo: 5 })).
|
|
73
|
-
expect(findE(list, { foo: -1 })).
|
|
71
|
+
expect(findE(list, { foo: 5 })).toEqual(None);
|
|
72
|
+
expect(findE(list, { foo: -1 })).toEqual(None);
|
|
74
73
|
|
|
75
74
|
// Entries in the list
|
|
76
|
-
expect(findE(list, e0)).
|
|
77
|
-
expect(findE(list, e1)).
|
|
78
|
-
expect(findE(list, e2)).
|
|
79
|
-
expect(findE(list, e3)).
|
|
75
|
+
expect(findE(list, e0)).toEqual(Some(0));
|
|
76
|
+
expect(findE(list, e1)).toEqual(Some(1));
|
|
77
|
+
expect(findE(list, e2)).toEqual(Some(2));
|
|
78
|
+
expect(findE(list, e3)).toEqual(Some(3));
|
|
80
79
|
|
|
81
80
|
// Entries comparing to entries in the list
|
|
82
|
-
expect(findE(list, { foo: 0 })).
|
|
83
|
-
expect(findE(list, { foo: 1 })).
|
|
84
|
-
expect(findE(list, { foo: 2 })).
|
|
81
|
+
expect(findE(list, { foo: 0 })).toEqual(None);
|
|
82
|
+
expect(findE(list, { foo: 1 })).toEqual(None);
|
|
83
|
+
expect(findE(list, { foo: 2 })).toEqual(None);
|
|
85
84
|
});
|
package/src/time.test.ts
CHANGED
package/src/time.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { present } from "./assert";
|
|
8
|
-
import { Cmp, type OrderFn } from "./order";
|
|
7
|
+
import { present } from "./assert.js";
|
|
8
|
+
import { Cmp, type OrderFn } from "./order.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Test if the given {@link Temporal.Instant} comes before a certain moment
|