55 order : 2
66---
77
8- HyperDB stores a fixed set of value types. Every value you write is ** normalized**
8+ HyperDB stores a fixed set of value types. Every value you write is normalized
99against its validator before it reaches the storage driver, which guarantees that
1010what comes back out matches your schema.
1111
@@ -14,7 +14,7 @@ what comes back out matches your schema.
1414| Validator | TypeScript type | Notes |
1515| ---------------------- | ---------------- | --------------------------------------------------------------------- |
1616| ` v.string() ` | ` string ` | |
17- | ` v.number() ` | ` number ` | ** Finite only** — ` NaN ` /` Infinity ` are rejected |
17+ | ` v.number() ` | ` number ` | Finite only; ` NaN ` /` Infinity ` are rejected |
1818| ` v.bigint() ` | ` bigint ` | |
1919| ` v.boolean() ` | ` boolean ` | |
2020| ` v.null() ` | ` null ` | |
@@ -30,30 +30,30 @@ what comes back out matches your schema.
3030
3131### Composite helpers
3232
33- - ` v.partial(objectValidator) ` — every field becomes optional.
34- - ` v.required(objectValidator, keys) ` — make listed optional fields required.
35- - ` v.lazy(() => validator) ` — defer resolution, useful for recursion.
33+ - ` v.partial(objectValidator) ` : every field becomes optional.
34+ - ` v.required(objectValidator, keys) ` : make listed optional fields required.
35+ - ` v.lazy(() => validator) ` : defer resolution, useful for recursion.
3636
3737## Binary data
3838
3939` v.arrayBuffer() ` accepts an ` ArrayBuffer ` directly, and also accepts any typed
40- array or ` DataView ` — these are copied into a fresh ` ArrayBuffer ` during
40+ array or ` DataView ` , which are copied into a fresh ` ArrayBuffer ` during
4141normalization. Storage drivers encode binary data appropriately:
4242
43- - The ** SQLite** drivers encode ` bigint ` , ` ArrayBuffer ` , and typed-array/data-view
43+ - The SQLite drivers encode ` bigint ` , ` ArrayBuffer ` , and typed-array/data-view
4444 values around JSON storage.
45- - The ** IndexedDB** driver uses the same storage encoding and sort-key ordering
45+ - The IndexedDB driver uses the same storage encoding and sort-key ordering
4646 as SQLite.
47- - The ** in-memory** driver stores normalized JS values directly.
47+ - The in-memory driver stores normalized JS values directly.
4848
4949## Indexable values
5050
51- Not every value can appear in an index. ** Indexable** value types are:
51+ Not every value can appear in an index. Indexable value types are:
5252
5353- ` string ` , finite ` number ` , ` bigint ` , ` boolean ` , ` null `
5454- ` ArrayBuffer ` and typed-array / ` DataView ` values
5555- ` v.literal(...) ` of an indexable primitive
56- - ` v.union(...) ` where ** every** variant is indexable
56+ - ` v.union(...) ` where every variant is indexable
5757- ` v.optional(...) ` of an indexable value
5858
5959If you try to build an index on a non-indexable column (an ` array ` , ` object ` ,
@@ -63,18 +63,18 @@ If you try to build an index on a non-indexable column (an `array`, `object`,
6363
6464` v.any() ` accepts arbitrary JSON-like structures but still enforces HyperDB's
6565storage rules: numbers must be finite, object keys cannot be empty or start with
66- ` $ ` , and ` undefined ` is rejected inside arrays. Use it sparingly — you lose the
66+ ` $ ` , and ` undefined ` is rejected inside arrays. Use it sparingly, since you lose the
6767type information and the index-ability that explicit validators give you.
6868
6969## Working with ` undefined `
7070
71- ` undefined ` is ** not a storable value** . The rules:
71+ ` undefined ` is not a storable value. The rules:
7272
73- - An ** optional object field** may be omitted. Writing ` { note: undefined } ` is
74- normalized to the field being absent — it round-trips as missing, not as
73+ - An optional object field may be omitted. Writing ` { note: undefined } ` is
74+ normalized to the field being absent, so it round-trips as missing, not as
7575 ` undefined ` .
76- - ` undefined ` is ** not allowed inside an array** (` [1, undefined] ` is rejected).
77- - ` undefined ` is ** not allowed as a record value** .
76+ - ` undefined ` is not allowed inside an array (` [1, undefined] ` is rejected).
77+ - ` undefined ` is not allowed as a record value.
7878
7979If you need to represent "explicitly empty", model it with ` v.null() ` instead of
8080relying on ` undefined ` .
0 commit comments