@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.
Files changed (69) hide show
  1. package/dist/assert.js +0 -2
  2. package/dist/assert.js.map +1 -1
  3. package/dist/assert.test.js +2 -2
  4. package/dist/assert.test.js.map +1 -1
  5. package/dist/async/abortable-promise.js +12 -9
  6. package/dist/async/abortable-promise.js.map +1 -1
  7. package/dist/async/abortable-promise.test.js +10 -1
  8. package/dist/async/abortable-promise.test.js.map +1 -1
  9. package/dist/async/emitter.js +2 -2
  10. package/dist/async/emitter.js.map +1 -1
  11. package/dist/async/emitter.test.js +2 -3
  12. package/dist/async/emitter.test.js.map +1 -1
  13. package/dist/async.d.ts +2 -2
  14. package/dist/async.js +3 -4
  15. package/dist/async.js.map +1 -1
  16. package/dist/collections/lfu-cache.js +3 -3
  17. package/dist/collections/lfu-cache.js.map +1 -1
  18. package/dist/collections/lfu-cache.test.d.ts +1 -1
  19. package/dist/collections/lfu-cache.test.js +12 -12
  20. package/dist/collections/lfu-cache.test.js.map +1 -1
  21. package/dist/collections/linked-list.js +1 -1
  22. package/dist/collections/linked-list.js.map +1 -1
  23. package/dist/collections/lru-cache.js +3 -3
  24. package/dist/collections/lru-cache.js.map +1 -1
  25. package/dist/collections/lru-cache.test.d.ts +1 -1
  26. package/dist/collections/lru-cache.test.js +10 -10
  27. package/dist/collections/lru-cache.test.js.map +1 -1
  28. package/dist/collections.d.ts +3 -3
  29. package/dist/collections.js +3 -3
  30. package/dist/collections.js.map +1 -1
  31. package/dist/decorators.test.js +1 -1
  32. package/dist/decorators.test.js.map +1 -1
  33. package/dist/disposable.d.ts +1 -1
  34. package/dist/disposable.js +1 -1
  35. package/dist/disposable.js.map +1 -1
  36. package/dist/disposable.test.js +1 -1
  37. package/dist/disposable.test.js.map +1 -1
  38. package/dist/index.d.ts +10 -10
  39. package/dist/index.js +10 -10
  40. package/dist/index.js.map +1 -1
  41. package/dist/logger.js.map +1 -1
  42. package/dist/order.test.d.ts +1 -1
  43. package/dist/order.test.js +11 -11
  44. package/dist/order.test.js.map +1 -1
  45. package/dist/time.js +2 -2
  46. package/dist/time.js.map +1 -1
  47. package/dist/time.test.js +1 -1
  48. package/dist/time.test.js.map +1 -1
  49. package/package.json +18 -39
  50. package/src/assert.test.ts +3 -3
  51. package/src/assert.ts +2 -6
  52. package/src/async/abortable-promise.test.ts +14 -1
  53. package/src/async/abortable-promise.ts +13 -9
  54. package/src/async/emitter.test.ts +2 -3
  55. package/src/async/emitter.ts +2 -2
  56. package/src/async.ts +3 -4
  57. package/src/collections/lfu-cache.test.ts +12 -13
  58. package/src/collections/lfu-cache.ts +3 -3
  59. package/src/collections/linked-list.ts +1 -1
  60. package/src/collections/lru-cache.test.ts +10 -11
  61. package/src/collections/lru-cache.ts +3 -3
  62. package/src/collections.ts +3 -3
  63. package/src/decorators.test.ts +1 -1
  64. package/src/disposable.test.ts +1 -1
  65. package/src/disposable.ts +1 -1
  66. package/src/index.ts +10 -10
  67. package/src/order.test.ts +11 -12
  68. package/src/time.test.ts +1 -1
  69. 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 })).isNone();
73
- expect(findE(list, { foo: -1 })).isNone();
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)).isSome(0);
77
- expect(findE(list, e1)).isSome(1);
78
- expect(findE(list, e2)).isSome(2);
79
- expect(findE(list, e3)).isSome(3);
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 })).isNone();
83
- expect(findE(list, { foo: 1 })).isNone();
84
- expect(findE(list, { foo: 2 })).isNone();
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
@@ -2,7 +2,7 @@ import "temporal-polyfill/global";
2
2
 
3
3
  import { expect, test } from "vitest";
4
4
 
5
- import { time } from ".";
5
+ import { time } from "./index.js";
6
6
 
7
7
  test("time.min", () => {
8
8
  const a = time.seconds(1);
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