shelving 1.158.0 → 1.158.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 (53) hide show
  1. package/db/CacheProvider.d.ts +1 -1
  2. package/db/Change.d.ts +1 -1
  3. package/db/ChangesProvider.d.ts +1 -1
  4. package/db/DebugProvider.d.ts +1 -1
  5. package/db/ItemStore.d.ts +1 -1
  6. package/db/MemoryProvider.d.ts +1 -1
  7. package/db/Provider.d.ts +1 -1
  8. package/db/Provider.js +1 -2
  9. package/db/QueryStore.d.ts +1 -1
  10. package/db/ThroughProvider.d.ts +1 -1
  11. package/db/ValidationProvider.d.ts +1 -1
  12. package/db/index.d.ts +5 -5
  13. package/db/index.js +7 -7
  14. package/error/BaseError.js +1 -1
  15. package/error/index.d.ts +1 -1
  16. package/error/index.js +1 -1
  17. package/firestore/client/FirestoreClientProvider.d.ts +1 -1
  18. package/firestore/lite/FirestoreLiteProvider.d.ts +1 -1
  19. package/firestore/server/FirestoreServerProvider.d.ts +1 -1
  20. package/markup/index.d.ts +2 -2
  21. package/markup/index.js +2 -2
  22. package/markup/render.js +2 -2
  23. package/markup/rule/code.js +1 -1
  24. package/markup/rule/fenced.js +2 -2
  25. package/markup/rule/heading.js +1 -1
  26. package/markup/rule/index.js +1 -2
  27. package/markup/rule/linebreak.js +1 -1
  28. package/markup/rule/ordered.js +2 -2
  29. package/markup/rule/separator.js +1 -1
  30. package/markup/rule/unordered.js +2 -2
  31. package/package.json +7 -7
  32. package/react/createDataContext.d.ts +1 -1
  33. package/schema/index.d.ts +5 -5
  34. package/schema/index.js +6 -6
  35. package/sequence/DeferredSequence.js +3 -1
  36. package/sequence/index.d.ts +1 -1
  37. package/sequence/index.js +1 -1
  38. package/store/ArrayStore.js +1 -2
  39. package/store/index.d.ts +2 -2
  40. package/store/index.js +2 -2
  41. package/util/array.d.ts +1 -1
  42. package/util/function.d.ts +1 -1
  43. package/util/function.js +1 -1
  44. package/util/iterate.js +2 -2
  45. package/util/jwt.js +2 -2
  46. package/util/merge.d.ts +1 -1
  47. package/util/merge.js +1 -1
  48. package/util/number.js +1 -1
  49. package/util/query.js +1 -2
  50. package/util/random.d.ts +1 -1
  51. package/util/sequence.d.ts +1 -2
  52. package/util/set.d.ts +3 -3
  53. package/util/url.js +1 -1
@@ -1,4 +1,4 @@
1
- import type { DataKey, Database } from "../util/data.js";
1
+ import type { Database, DataKey } from "../util/data.js";
2
2
  import type { Identifier, Items, OptionalItem } from "../util/item.js";
3
3
  import type { ItemQuery } from "../util/query.js";
4
4
  import type { Sourceable } from "../util/source.js";
package/db/Change.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ImmutableArray } from "../util/array.js";
2
- import type { DataKey, Database } from "../util/data.js";
2
+ import type { Database, DataKey } from "../util/data.js";
3
3
  import type { Identifier } from "../util/item.js";
4
4
  import { type Nullish } from "../util/null.js";
5
5
  import type { ItemQuery } from "../util/query.js";
@@ -1,5 +1,5 @@
1
1
  import type { MutableArray } from "../util/array.js";
2
- import type { DataKey, Database } from "../util/data.js";
2
+ import type { Database, DataKey } from "../util/data.js";
3
3
  import type { Identifier } from "../util/item.js";
4
4
  import type { ItemQuery } from "../util/query.js";
5
5
  import type { Updates } from "../util/update.js";
@@ -1,4 +1,4 @@
1
- import type { DataKey, Database } from "../util/data.js";
1
+ import type { Database, DataKey } from "../util/data.js";
2
2
  import type { Identifier, Items, OptionalItem } from "../util/item.js";
3
3
  import type { ItemQuery } from "../util/query.js";
4
4
  import type { Updates } from "../util/update.js";
package/db/ItemStore.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BooleanStore } from "../store/BooleanStore.js";
2
2
  import { OptionalDataStore } from "../store/DataStore.js";
3
- import type { DataKey, Database } from "../util/data.js";
3
+ import type { Database, DataKey } from "../util/data.js";
4
4
  import type { Identifier, Item } from "../util/item.js";
5
5
  import type { StopCallback } from "../util/start.js";
6
6
  import type { MemoryProvider } from "./MemoryProvider.js";
@@ -1,5 +1,5 @@
1
1
  import { DeferredSequence } from "../sequence/DeferredSequence.js";
2
- import type { Data, DataKey, Database } from "../util/data.js";
2
+ import type { Data, Database, DataKey } from "../util/data.js";
3
3
  import type { Identifier, Item, Items, OptionalItem } from "../util/item.js";
4
4
  import type { ItemQuery } from "../util/query.js";
5
5
  import type { Updates } from "../util/update.js";
package/db/Provider.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { DataKey, Database } from "../util/data.js";
1
+ import type { Database, DataKey } from "../util/data.js";
2
2
  import type { Identifier, Item, Items, OptionalItem } from "../util/item.js";
3
3
  import type { ItemQuery } from "../util/query.js";
4
4
  import type { Updates } from "../util/update.js";
package/db/Provider.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { RequiredError } from "../error/RequiredError.js";
2
- import { countArray } from "../util/array.js";
3
- import { getFirst } from "../util/array.js";
2
+ import { countArray, getFirst } from "../util/array.js";
4
3
  /** Provider with a fully synchronous interface */
5
4
  export class Provider {
6
5
  requireItem(collection, id) {
@@ -1,6 +1,6 @@
1
1
  import { ArrayStore } from "../store/ArrayStore.js";
2
2
  import { BooleanStore } from "../store/BooleanStore.js";
3
- import type { DataKey, Database } from "../util/data.js";
3
+ import type { Database, DataKey } from "../util/data.js";
4
4
  import type { Identifier, Item } from "../util/item.js";
5
5
  import type { ItemQuery } from "../util/query.js";
6
6
  import type { StopCallback } from "../util/start.js";
@@ -1,4 +1,4 @@
1
- import type { DataKey, Database } from "../util/data.js";
1
+ import type { Database, DataKey } from "../util/data.js";
2
2
  import type { Identifier, Item, Items, OptionalItem } from "../util/item.js";
3
3
  import type { ItemQuery } from "../util/query.js";
4
4
  import type { Sourceable } from "../util/source.js";
@@ -1,6 +1,6 @@
1
1
  import type { DataSchema, DataSchemas } from "../schema/DataSchema.js";
2
2
  import type { Schema } from "../schema/Schema.js";
3
- import type { DataKey, Database } from "../util/data.js";
3
+ import type { Database, DataKey } from "../util/data.js";
4
4
  import type { Identifier, Items, OptionalItem } from "../util/item.js";
5
5
  import type { ItemQuery } from "../util/query.js";
6
6
  import type { Sourceable } from "../util/source.js";
package/db/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export * from "./ItemStore.js";
2
- export * from "./QueryStore.js";
3
- export * from "./Provider.js";
4
- export * from "./ThroughProvider.js";
5
1
  export * from "./CacheProvider.js";
2
+ export * from "./Change.js";
6
3
  export * from "./ChangesProvider.js";
7
4
  export * from "./DebugProvider.js";
5
+ export * from "./ItemStore.js";
8
6
  export * from "./MemoryProvider.js";
7
+ export * from "./Provider.js";
8
+ export * from "./QueryStore.js";
9
+ export * from "./ThroughProvider.js";
9
10
  export * from "./ValidationProvider.js";
10
- export * from "./Change.js";
package/db/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  // Stores.
2
- export * from "./ItemStore.js";
3
- export * from "./QueryStore.js";
4
- // Providers.
5
- export * from "./Provider.js";
6
- export * from "./ThroughProvider.js";
7
2
  export * from "./CacheProvider.js";
3
+ // Util.
4
+ export * from "./Change.js";
8
5
  export * from "./ChangesProvider.js";
9
6
  export * from "./DebugProvider.js";
7
+ export * from "./ItemStore.js";
10
8
  export * from "./MemoryProvider.js";
9
+ // Providers.
10
+ export * from "./Provider.js";
11
+ export * from "./QueryStore.js";
12
+ export * from "./ThroughProvider.js";
11
13
  export * from "./ValidationProvider.js";
12
- // Util.
13
- export * from "./Change.js";
@@ -2,7 +2,7 @@
2
2
  export class BaseError extends Error {
3
3
  constructor(message, options = {}) {
4
4
  super(message, options);
5
- const { cause, caller = BaseError, ...rest } = options;
5
+ const { _cause, caller = BaseError, ...rest } = options;
6
6
  for (const [key, value] of Object.entries(rest))
7
7
  this[key] = value;
8
8
  Error.captureStackTrace(this, caller);
package/error/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export * from "./BaseError.js";
2
2
  export * from "./NetworkError.js";
3
- export * from "./ResponseError.js";
4
3
  export * from "./RequestError.js";
5
4
  export * from "./RequiredError.js";
5
+ export * from "./ResponseError.js";
6
6
  export * from "./UnexpectedError.js";
7
7
  export * from "./UnimplementedError.js";
8
8
  export * from "./ValueError.js";
package/error/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export * from "./BaseError.js";
2
2
  export * from "./NetworkError.js";
3
- export * from "./ResponseError.js";
4
3
  export * from "./RequestError.js";
5
4
  export * from "./RequiredError.js";
5
+ export * from "./ResponseError.js";
6
6
  export * from "./UnexpectedError.js";
7
7
  export * from "./UnimplementedError.js";
8
8
  export * from "./ValueError.js";
@@ -1,6 +1,6 @@
1
1
  import type { Firestore } from "firebase/firestore";
2
2
  import { AsyncProvider } from "../../db/Provider.js";
3
- import type { Data, DataKey, Database } from "../../util/data.js";
3
+ import type { Data, Database, DataKey } from "../../util/data.js";
4
4
  import type { Items, OptionalItem } from "../../util/item.js";
5
5
  import type { ItemQuery } from "../../util/query.js";
6
6
  import type { Updates } from "../../util/update.js";
@@ -1,6 +1,6 @@
1
1
  import type { Firestore } from "firebase/firestore/lite";
2
2
  import { AsyncProvider } from "../../db/Provider.js";
3
- import type { Data, DataKey, Database } from "../../util/data.js";
3
+ import type { Data, Database, DataKey } from "../../util/data.js";
4
4
  import type { Items, OptionalItem } from "../../util/item.js";
5
5
  import type { ItemQuery } from "../../util/query.js";
6
6
  import type { Updates } from "../../util/update.js";
@@ -1,6 +1,6 @@
1
1
  import { Firestore } from "@google-cloud/firestore";
2
2
  import { AsyncProvider } from "../../db/Provider.js";
3
- import type { DataKey, Database } from "../../util/data.js";
3
+ import type { Database, DataKey } from "../../util/data.js";
4
4
  import type { Items, OptionalItem } from "../../util/item.js";
5
5
  import type { ItemQuery } from "../../util/query.js";
6
6
  import type { Updates } from "../../util/update.js";
package/markup/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./util/options.js";
2
- export * from "./util/rule.js";
3
2
  export * from "./util/regexp.js";
4
- export * from "./rule/index.js";
3
+ export * from "./util/rule.js";
5
4
  export * from "./render.js";
5
+ export * from "./rule/index.js";
package/markup/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from "./util/options.js";
2
- export * from "./util/rule.js";
3
2
  export * from "./util/regexp.js";
3
+ export * from "./util/rule.js";
4
4
  // export * from "./util/internal.js"; // Not exported.
5
- export * from "./rule/index.js";
6
5
  export * from "./render.js";
6
+ export * from "./rule/index.js";
package/markup/render.js CHANGED
@@ -27,8 +27,8 @@ context,
27
27
  offset = 0) {
28
28
  // The best matched rule is the one with the highest priority.
29
29
  // If two have equal priority use the earliest match in the string.
30
- let bestMatch = undefined;
31
- let bestRule = undefined;
30
+ let bestMatch;
31
+ let bestRule;
32
32
  // Loop through all rules in the list and see if any match.
33
33
  for (const rule of options.rules) {
34
34
  const { priority, regexp, contexts } = rule;
@@ -10,7 +10,7 @@ const CODE_REGEXP = getRegExp(`(?<fence>\`+)(?<code>${BLOCK_CONTENT_REGEXP})\\k<
10
10
  * - Closing characters must exactly match opening characters.
11
11
  * - Same as Markdown syntax.
12
12
  */
13
- export const CODE_RULE = getMarkupRule(CODE_REGEXP, ({ groups: { code } }, options, key) => ({
13
+ export const CODE_RULE = getMarkupRule(CODE_REGEXP, ({ groups: { code } }, _options, key) => ({
14
14
  key,
15
15
  $$typeof: REACT_ELEMENT_TYPE,
16
16
  type: "code",
@@ -1,5 +1,5 @@
1
1
  import { REACT_ELEMENT_TYPE } from "../util/internal.js";
2
- import { BLOCK_CONTENT_REGEXP, BLOCK_START_REGEXP, LINE_CONTENT_REGEXP, LINE_SPACE_REGEXP, getBlockRegExp } from "../util/regexp.js";
2
+ import { BLOCK_CONTENT_REGEXP, BLOCK_START_REGEXP, getBlockRegExp, LINE_CONTENT_REGEXP, LINE_SPACE_REGEXP } from "../util/regexp.js";
3
3
  import { getMarkupRule } from "../util/rule.js";
4
4
  const FENCE = "`{3,}|~{3,}";
5
5
  const FENCED_REGEXP = getBlockRegExp(`(?<code>${BLOCK_CONTENT_REGEXP})`,
@@ -16,7 +16,7 @@ const FENCED_REGEXP = getBlockRegExp(`(?<code>${BLOCK_CONTENT_REGEXP})`,
16
16
  * - If there's no closing fence the code block will run to the end of the current string.
17
17
  * - Markdown-style four-space indent syntax is not supported (only fenced code since it's less confusing and more common).
18
18
  */
19
- export const FENCED_RULE = getMarkupRule(FENCED_REGEXP, ({ groups: { title, code } }, options, key) => ({
19
+ export const FENCED_RULE = getMarkupRule(FENCED_REGEXP, ({ groups: { title, code } }, _options, key) => ({
20
20
  key,
21
21
  $$typeof: REACT_ELEMENT_TYPE,
22
22
  type: "pre",
@@ -1,6 +1,6 @@
1
1
  import { renderMarkup } from "../render.js";
2
2
  import { REACT_ELEMENT_TYPE } from "../util/internal.js";
3
- import { LINE_CONTENT_REGEXP, LINE_SPACE_REGEXP, getLineRegExp } from "../util/regexp.js";
3
+ import { getLineRegExp, LINE_CONTENT_REGEXP, LINE_SPACE_REGEXP } from "../util/regexp.js";
4
4
  import { getMarkupRule } from "../util/rule.js";
5
5
  const HEADING_REGEXP = getLineRegExp(`(?<prefix>#{1,6})(?:${LINE_SPACE_REGEXP}+(?<heading>${LINE_CONTENT_REGEXP}))?`);
6
6
  /**
@@ -4,8 +4,7 @@ import { FENCED_RULE } from "./fenced.js";
4
4
  import { HEADING_RULE } from "./heading.js";
5
5
  import { INLINE_RULE } from "./inline.js";
6
6
  import { LINEBREAK_RULE } from "./linebreak.js";
7
- import { LINK_RULE } from "./link.js";
8
- import { AUTOLINK_RULE } from "./link.js";
7
+ import { AUTOLINK_RULE, LINK_RULE } from "./link.js";
9
8
  import { ORDERED_RULE } from "./ordered.js";
10
9
  import { PARAGRAPH_RULE } from "./paragraph.js";
11
10
  import { SEPARATOR_RULE } from "./separator.js";
@@ -10,7 +10,7 @@ import { getMarkupRule } from "../util/rule.js";
10
10
  * - This is more intuitive (a linebreak becomes a linebreak is isn't silently ignored).
11
11
  * - This works better with textareas that wrap text (since manually breaking up long lines is no longer necessary).
12
12
  */
13
- export const LINEBREAK_RULE = getMarkupRule(/[^\n\S]*\n[^\n\S]*/, (match, options, key) => ({
13
+ export const LINEBREAK_RULE = getMarkupRule(/[^\n\S]*\n[^\n\S]*/, (_match, _options, key) => ({
14
14
  key,
15
15
  $$typeof: REACT_ELEMENT_TYPE,
16
16
  type: "br",
@@ -1,6 +1,6 @@
1
1
  import { renderMarkup } from "../render.js";
2
2
  import { REACT_ELEMENT_TYPE } from "../util/internal.js";
3
- import { BLOCK_CONTENT_REGEXP, BLOCK_SPACE_REGEXP, LINE_SPACE_REGEXP, getBlockRegExp } from "../util/regexp.js";
3
+ import { BLOCK_CONTENT_REGEXP, BLOCK_SPACE_REGEXP, getBlockRegExp, LINE_SPACE_REGEXP } from "../util/regexp.js";
4
4
  import { getMarkupRule } from "../util/rule.js";
5
5
  const INDENT = /^\t/gm; // Nesting is recognised with tabs only.
6
6
  const NUMBER = "\\d{1,9}[.):]"; // Number for a numbered list, e.g. `1.` or `2)` or `3:` followed by one or more spaces.
@@ -24,7 +24,7 @@ export const ORDERED_RULE = getMarkupRule(ORDERED_REGEXP, ({ groups: { list } },
24
24
  /** Parse a markdown list into a set of items elements. */
25
25
  function* _getOrderedItems(list, options) {
26
26
  let key = 0;
27
- for (const [unused, number = "", item = ""] of list.matchAll(ITEM)) {
27
+ for (const [_unused, number = "", item = ""] of list.matchAll(ITEM)) {
28
28
  yield {
29
29
  $$typeof: REACT_ELEMENT_TYPE,
30
30
  type: "li",
@@ -9,7 +9,7 @@ const SEPARATOR_REGEXP = getLineRegExp("([-*•+_=])(?: *\\1){2,}");
9
9
  * - Character must be the same every time (can't mix)
10
10
  * - Might have infinite number of spaces between the characters.
11
11
  */
12
- export const SEPARATOR_RULE = getMarkupRule(SEPARATOR_REGEXP, (match, options, key) => ({
12
+ export const SEPARATOR_RULE = getMarkupRule(SEPARATOR_REGEXP, (_match, _options, key) => ({
13
13
  key,
14
14
  $$typeof: REACT_ELEMENT_TYPE,
15
15
  type: "hr",
@@ -1,6 +1,6 @@
1
1
  import { renderMarkup } from "../render.js";
2
2
  import { REACT_ELEMENT_TYPE } from "../util/internal.js";
3
- import { BLOCK_CONTENT_REGEXP, BLOCK_SPACE_REGEXP, LINE_SPACE_REGEXP, getBlockRegExp } from "../util/regexp.js";
3
+ import { BLOCK_CONTENT_REGEXP, BLOCK_SPACE_REGEXP, getBlockRegExp, LINE_SPACE_REGEXP } from "../util/regexp.js";
4
4
  import { getMarkupRule } from "../util/rule.js";
5
5
  const INDENT = /^\t/gm; // Nesting is recognised with tabs only.
6
6
  const BULLET = "[-*•+]"; // Allowed bullet symbol.
@@ -25,7 +25,7 @@ export const UNORDERED_RULE = getMarkupRule(UNORDERED_REGEXP, ({ groups: { list
25
25
  /** Parse a markdown list into a set of items elements. */
26
26
  export function* _getItems(list, options) {
27
27
  let key = 0;
28
- for (const [unused, item = ""] of list.matchAll(ITEM)) {
28
+ for (const [_unused, item = ""] of list.matchAll(ITEM)) {
29
29
  yield {
30
30
  $$typeof: REACT_ELEMENT_TYPE,
31
31
  type: "li",
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "state-management",
12
12
  "query-builder"
13
13
  ],
14
- "version": "1.158.0",
14
+ "version": "1.158.1",
15
15
  "repository": "https://github.com/dhoulb/shelving",
16
16
  "author": "Dave Houlbrooke <dave@shax.com>",
17
17
  "license": "0BSD",
@@ -57,14 +57,14 @@
57
57
  "build:test:unit": "bun test ./dist/**/*.test.js --bail"
58
58
  },
59
59
  "devDependencies": {
60
- "@biomejs/biome": "^1.9.4",
60
+ "@biomejs/biome": "^2.2.6",
61
61
  "@google-cloud/firestore": "^7.11.6",
62
- "@types/bun": "^1.2.23",
63
- "@types/react": "^19.1.16",
64
- "@types/react-dom": "^19.1.9",
62
+ "@types/bun": "^1.3.0",
63
+ "@types/react": "^19.2.2",
64
+ "@types/react-dom": "^19.2.2",
65
65
  "firebase": "^11.10.0",
66
- "react": "^19.1.1",
67
- "react-dom": "^19.1.1",
66
+ "react": "^19.2.0",
67
+ "react-dom": "^19.2.0",
68
68
  "typescript": "^5.9.3"
69
69
  },
70
70
  "peerDependencies": {
@@ -2,7 +2,7 @@ import type { ReactElement, ReactNode } from "react";
2
2
  import { ItemStore } from "../db/ItemStore.js";
3
3
  import type { AbstractProvider } from "../db/Provider.js";
4
4
  import { QueryStore } from "../db/QueryStore.js";
5
- import type { DataKey, Database } from "../util/data.js";
5
+ import type { Database, DataKey } from "../util/data.js";
6
6
  import type { Identifier } from "../util/item.js";
7
7
  import type { Nullish } from "../util/null.js";
8
8
  import type { ItemQuery } from "../util/query.js";
package/schema/index.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- export * from "./Schema.js";
2
- export * from "./ThroughSchema.js";
3
- export * from "./NullableSchema.js";
4
- export * from "./OptionalSchema.js";
5
- export * from "./RequiredSchema.js";
6
1
  export * from "./ArraySchema.js";
7
2
  export * from "./BooleanSchema.js";
8
3
  export * from "./ChoiceSchema.js";
@@ -16,9 +11,14 @@ export * from "./EntitySchema.js";
16
11
  export * from "./FileSchema.js";
17
12
  export * from "./KeySchema.js";
18
13
  export * from "./LinkSchema.js";
14
+ export * from "./NullableSchema.js";
19
15
  export * from "./NumberSchema.js";
16
+ export * from "./OptionalSchema.js";
20
17
  export * from "./PhoneSchema.js";
18
+ export * from "./RequiredSchema.js";
19
+ export * from "./Schema.js";
21
20
  export * from "./SlugSchema.js";
22
21
  export * from "./StringSchema.js";
22
+ export * from "./ThroughSchema.js";
23
23
  export * from "./TimeSchema.js";
24
24
  export * from "./UUIDSchema.js";
package/schema/index.js CHANGED
@@ -1,9 +1,3 @@
1
- export * from "./Schema.js";
2
- // Utility schemas.
3
- export * from "./ThroughSchema.js";
4
- export * from "./NullableSchema.js";
5
- export * from "./OptionalSchema.js";
6
- export * from "./RequiredSchema.js";
7
1
  // Field schemas.
8
2
  export * from "./ArraySchema.js";
9
3
  export * from "./BooleanSchema.js";
@@ -18,9 +12,15 @@ export * from "./EntitySchema.js";
18
12
  export * from "./FileSchema.js";
19
13
  export * from "./KeySchema.js";
20
14
  export * from "./LinkSchema.js";
15
+ export * from "./NullableSchema.js";
21
16
  export * from "./NumberSchema.js";
17
+ export * from "./OptionalSchema.js";
22
18
  export * from "./PhoneSchema.js";
19
+ export * from "./RequiredSchema.js";
20
+ export * from "./Schema.js";
23
21
  export * from "./SlugSchema.js";
24
22
  export * from "./StringSchema.js";
23
+ // Utility schemas.
24
+ export * from "./ThroughSchema.js";
25
25
  export * from "./TimeSchema.js";
26
26
  export * from "./UUIDSchema.js";
@@ -40,7 +40,9 @@ export class DeferredSequence extends AbstractSequence {
40
40
  }
41
41
  /** Fulfill the current deferred by resolving or rejecting it. */
42
42
  _fulfill() {
43
- const { _deferred, _nextReason, _nextValue } = this;
43
+ const _deferred = this._deferred;
44
+ const _nextReason = this._nextReason;
45
+ const _nextValue = this._nextValue;
44
46
  this._nextReason = _NOVALUE;
45
47
  this._nextValue = _NOVALUE;
46
48
  if (_deferred) {
@@ -1,6 +1,6 @@
1
1
  export * from "./AbstractSequence.js";
2
2
  export * from "./DeferredSequence.js";
3
3
  export * from "./InspectSequence.js";
4
+ export * from "./IteratorSequence.js";
4
5
  export * from "./LazyDeferredSequence.js";
5
6
  export * from "./ThroughSequence.js";
6
- export * from "./IteratorSequence.js";
package/sequence/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from "./AbstractSequence.js";
2
2
  export * from "./DeferredSequence.js";
3
3
  export * from "./InspectSequence.js";
4
+ export * from "./IteratorSequence.js";
4
5
  export * from "./LazyDeferredSequence.js";
5
6
  export * from "./ThroughSequence.js";
6
- export * from "./IteratorSequence.js";
@@ -1,5 +1,4 @@
1
- import { omitArrayItems, toggleArrayItems, withArrayItems } from "../util/array.js";
2
- import { getFirst, getLast, requireFirst, requireLast } from "../util/array.js";
1
+ import { getFirst, getLast, omitArrayItems, requireFirst, requireLast, toggleArrayItems, withArrayItems } from "../util/array.js";
3
2
  import { Store } from "./Store.js";
4
3
  /** Store an array. */
5
4
  export class ArrayStore extends Store {
package/store/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export * from "./Store.js";
2
1
  export * from "./ArrayStore.js";
3
2
  export * from "./BooleanStore.js";
4
3
  export * from "./DataStore.js";
5
- export * from "./PathStore.js";
6
4
  export * from "./DictionaryStore.js";
5
+ export * from "./PathStore.js";
6
+ export * from "./Store.js";
package/store/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export * from "./Store.js";
2
1
  export * from "./ArrayStore.js";
3
2
  export * from "./BooleanStore.js";
4
3
  export * from "./DataStore.js";
5
- export * from "./PathStore.js";
6
4
  export * from "./DictionaryStore.js";
5
+ export * from "./PathStore.js";
6
+ export * from "./Store.js";
package/util/array.d.ts CHANGED
@@ -27,7 +27,7 @@ export declare function isArray<T>(arr: ImmutableArray<T>, min: 3, max: 3): arr
27
27
  export declare function isArray<T>(arr: ImmutableArray<T>, min?: 1, max?: number): arr is readonly [T, ...T[]];
28
28
  export declare function isArray<T>(arr: ImmutableArray<T>, min: 2, max?: number): arr is readonly [T, T, ...T[]];
29
29
  export declare function isArray<T>(arr: ImmutableArray<T>, min: 3, max?: number): arr is readonly [T, T, T, ...T[]];
30
- export declare function isArray<T>(value: unknown, min?: number, max?: number): value is ImmutableArray;
30
+ export declare function isArray<T>(value: unknown, min?: number, max?: number): value is ImmutableArray<T>;
31
31
  /** Assert that an unknown value is an array (optionally with specified min/max length). */
32
32
  export declare function assertArray<T>(arr: MutableArray<T>, min: 1, max: 1, caller?: AnyCaller): asserts arr is [T];
33
33
  export declare function assertArray<T>(arr: MutableArray<T>, min: 2, max: 2, caller?: AnyCaller): asserts arr is [T, T];
@@ -14,4 +14,4 @@ export type Arguments = readonly unknown[];
14
14
  /** Function that just passes through the first argument. */
15
15
  export declare function PASSTHROUGH<T>(value: T): T;
16
16
  /** Function that does nothing with its arguments and always returns void. */
17
- export declare function BLACKHOLE(...unused: Arguments): void | undefined;
17
+ export declare function BLACKHOLE(..._unused: Arguments): void | undefined;
package/util/function.js CHANGED
@@ -14,6 +14,6 @@ export function PASSTHROUGH(value) {
14
14
  }
15
15
  /** Function that does nothing with its arguments and always returns void. */
16
16
  // biome-ignore lint/suspicious/noConfusingVoidType: Allow `BLACKHOLE` to be used in places that allow `void`
17
- export function BLACKHOLE(...unused) {
17
+ export function BLACKHOLE(..._unused) {
18
18
  return undefined;
19
19
  }
package/util/iterate.js CHANGED
@@ -13,14 +13,14 @@ export function* flattenItems(items) {
13
13
  * - Checks `items.size` or `items.length` first, or consumes the iterable and counts its iterations.
14
14
  */
15
15
  export function hasItems(items) {
16
- for (const unused of items)
16
+ for (const _unused of items)
17
17
  return true;
18
18
  return false;
19
19
  }
20
20
  /** Count the number of items in an iterable. */
21
21
  export function countItems(items) {
22
22
  let count = 0;
23
- for (const unused of items)
23
+ for (const _unused of items)
24
24
  count++;
25
25
  return count;
26
26
  }
package/util/jwt.js CHANGED
@@ -84,9 +84,9 @@ export async function verifyToken(token, secret, caller = verifyToken) {
84
84
  const { header, payload, signature, headerData, payloadData } = splitToken(token, caller);
85
85
  // Validate header.
86
86
  if (headerData.typ !== HEADER.typ)
87
- throw new UnauthorizedError(`JWT header type must be \"${HEADER.typ}\"`, { received: headerData.typ, caller });
87
+ throw new UnauthorizedError(`JWT header type must be "${HEADER.typ}"`, { received: headerData.typ, caller });
88
88
  if (headerData.alg !== HEADER.alg)
89
- throw new UnauthorizedError(`JWT header algorithm must be \"${HEADER.alg}\"`, { received: headerData.alg, caller });
89
+ throw new UnauthorizedError(`JWT header algorithm must be "${HEADER.alg}"`, { received: headerData.alg, caller });
90
90
  // Validate signature.
91
91
  const key = await _getKey(verifyToken, secret, "verify");
92
92
  const isValid = await crypto.subtle.verify("HMAC", key, decodeBase64URLBytes(signature), requireBytes(`${header}.${payload}`));
package/util/merge.d.ts CHANGED
@@ -5,7 +5,7 @@ type MergeRecursor = (left: unknown, right: unknown) => unknown;
5
5
  * Exact merge two unknown values.
6
6
  * - Always returns `right`.
7
7
  */
8
- export declare function exactMerge(left: unknown, right: unknown): unknown;
8
+ export declare function exactMerge(_left: unknown, right: unknown): unknown;
9
9
  /**
10
10
  * Shallow merge two unknown values.
11
11
  *
package/util/merge.js CHANGED
@@ -14,7 +14,7 @@ function _merge(left, right, recursor) {
14
14
  * Exact merge two unknown values.
15
15
  * - Always returns `right`.
16
16
  */
17
- export function exactMerge(left, right) {
17
+ export function exactMerge(_left, right) {
18
18
  return right;
19
19
  }
20
20
  export function shallowMerge(left, right) {
package/util/number.js CHANGED
@@ -158,7 +158,7 @@ export function sumNumbers(nums) {
158
158
  }
159
159
  /** Find the number that's closest to a target in an iterable set of numbers. */
160
160
  export function getClosestNumber(nums, target) {
161
- let closest = undefined;
161
+ let closest;
162
162
  for (const item of nums)
163
163
  if (closest === undefined || Math.abs(item - target) < Math.abs(closest - target))
164
164
  closest = item;
package/util/query.js CHANGED
@@ -1,5 +1,4 @@
1
- import { isArray, limitArray } from "./array.js";
2
- import { requireLast } from "./array.js";
1
+ import { isArray, limitArray, requireLast } from "./array.js";
3
2
  import { getDataProp } from "./data.js";
4
3
  import { isArrayWith, isEqual, isEqualGreater, isEqualLess, isGreater, isInArray, isLess, notEqual, notInArray } from "./equal.js";
5
4
  import { limitItems } from "./iterate.js";
package/util/random.d.ts CHANGED
@@ -13,4 +13,4 @@ export declare function getRandomKey(length?: number): string;
13
13
  /** Get a random character from a string. */
14
14
  export declare function getRandomCharacter(str: string): string;
15
15
  /** Get a random item from an array or random character from a string string. */
16
- export declare function getRandomItem<I, T>(arr: ImmutableArray<T>): T;
16
+ export declare function getRandomItem<T>(arr: ImmutableArray<T>): T;
@@ -1,5 +1,4 @@
1
- import type { AsyncValueCallback, ValueCallback } from "./callback.js";
2
- import type { ErrorCallback } from "./callback.js";
1
+ import type { AsyncValueCallback, ErrorCallback, ValueCallback } from "./callback.js";
3
2
  import { STOP } from "./constants.js";
4
3
  import type { StopCallback } from "./start.js";
5
4
  /**
package/util/set.d.ts CHANGED
@@ -16,11 +16,11 @@ export declare function getSet<T>(value: PossibleSet<T>): ImmutableSet;
16
16
  /** Apply a limit to a set. */
17
17
  export declare function limitSet<T>(set: ImmutableSet<T>, limit: number): ImmutableSet<T>;
18
18
  /** Is an unknown value an item in a set? */
19
- export declare function isSetItem<I, T>(set: ImmutableSet<T>, item: unknown): item is T;
19
+ export declare function isSetItem<T>(set: ImmutableSet<T>, item: unknown): item is T;
20
20
  /** Assert that an unknown value is an item in a set. */
21
- export declare function assertSetItem<I, T>(set: ImmutableSet<T>, item: unknown, caller?: AnyCaller): asserts item is T;
21
+ export declare function assertSetItem<T>(set: ImmutableSet<T>, item: unknown, caller?: AnyCaller): asserts item is T;
22
22
  /** Add an item to a set (by reference) and return the set item. */
23
- export declare function addSetItem<I, T>(set: MutableSet<T>, item: T): T;
23
+ export declare function addSetItem<T>(set: MutableSet<T>, item: T): T;
24
24
  /** Add multiple items to a set (by reference). */
25
25
  export declare function addSetItems<T>(set: MutableSet<T>, ...items: T[]): void;
26
26
  /** Remove multiple items from a set (by reference). */
package/util/url.js CHANGED
@@ -15,7 +15,7 @@ export function getURL(possible, base = _BASE) {
15
15
  try {
16
16
  return isURL(possible) ? possible : new URL(possible, base);
17
17
  }
18
- catch (e) {
18
+ catch (_e) {
19
19
  //
20
20
  }
21
21
  }