@effect-dynamodb/schema 1.39.0 → 1.41.0
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/Aggregate.d.ts +11 -4
- package/dist/Aggregate.d.ts.map +1 -1
- package/dist/Aggregate.js +12 -2
- package/dist/Aggregate.js.map +1 -1
- package/dist/DynamoModel.d.ts +48 -7
- package/dist/DynamoModel.d.ts.map +1 -1
- package/dist/DynamoModel.js +34 -16
- package/dist/DynamoModel.js.map +1 -1
- package/dist/DynamoSchema.d.ts +25 -0
- package/dist/DynamoSchema.d.ts.map +1 -1
- package/dist/DynamoSchema.js.map +1 -1
- package/dist/Entity.d.ts +66 -11
- package/dist/Entity.d.ts.map +1 -1
- package/dist/Entity.js +261 -34
- package/dist/Entity.js.map +1 -1
- package/dist/Errors.d.ts +61 -4
- package/dist/Errors.d.ts.map +1 -1
- package/dist/Errors.js +83 -6
- package/dist/Errors.js.map +1 -1
- package/dist/KeyComposer.d.ts +196 -5
- package/dist/KeyComposer.d.ts.map +1 -1
- package/dist/KeyComposer.js +490 -54
- package/dist/KeyComposer.js.map +1 -1
- package/dist/VectorIndex.d.ts.map +1 -1
- package/dist/VectorIndex.js +5 -4
- package/dist/VectorIndex.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/AggregateEdges.d.ts +3 -3
- package/dist/internal/AggregateSchemas.d.ts +306 -14
- package/dist/internal/AggregateSchemas.d.ts.map +1 -1
- package/dist/internal/AggregateSchemas.js +733 -54
- package/dist/internal/AggregateSchemas.js.map +1 -1
- package/dist/internal/AggregateTypes.d.ts +396 -36
- package/dist/internal/AggregateTypes.d.ts.map +1 -1
- package/dist/internal/CompositeCodec.d.ts +298 -8
- package/dist/internal/CompositeCodec.d.ts.map +1 -1
- package/dist/internal/CompositeCodec.js +940 -34
- package/dist/internal/CompositeCodec.js.map +1 -1
- package/dist/internal/EffectInstances.d.ts +87 -0
- package/dist/internal/EffectInstances.d.ts.map +1 -0
- package/dist/internal/EffectInstances.js +662 -0
- package/dist/internal/EffectInstances.js.map +1 -0
- package/dist/internal/EntityPacked.d.ts.map +1 -1
- package/dist/internal/EntityPacked.js +5 -4
- package/dist/internal/EntityPacked.js.map +1 -1
- package/dist/internal/EntitySchemas.d.ts +239 -30
- package/dist/internal/EntitySchemas.d.ts.map +1 -1
- package/dist/internal/EntitySchemas.js +1600 -197
- package/dist/internal/EntitySchemas.js.map +1 -1
- package/dist/internal/EntityTypes.d.ts +114 -25
- package/dist/internal/EntityTypes.d.ts.map +1 -1
- package/dist/internal/FailingAsBefore.d.ts +25 -0
- package/dist/internal/FailingAsBefore.d.ts.map +1 -0
- package/dist/internal/FailingAsBefore.js +42 -0
- package/dist/internal/FailingAsBefore.js.map +1 -0
- package/dist/internal/InstanceReads.d.ts +40 -0
- package/dist/internal/InstanceReads.d.ts.map +1 -0
- package/dist/internal/InstanceReads.js +183 -0
- package/dist/internal/InstanceReads.js.map +1 -0
- package/dist/internal/KeyReadings.d.ts +30 -0
- package/dist/internal/KeyReadings.d.ts.map +1 -0
- package/dist/internal/KeyReadings.js +99 -0
- package/dist/internal/KeyReadings.js.map +1 -0
- package/dist/internal/KeyText136.d.ts +4 -2
- package/dist/internal/KeyText136.d.ts.map +1 -1
- package/dist/internal/KeyText136.js +46 -13
- package/dist/internal/KeyText136.js.map +1 -1
- package/dist/internal/LostValues.d.ts +50 -0
- package/dist/internal/LostValues.d.ts.map +1 -0
- package/dist/internal/LostValues.js +465 -0
- package/dist/internal/LostValues.js.map +1 -0
- package/dist/internal/NumericKey.d.ts +21 -2
- package/dist/internal/NumericKey.d.ts.map +1 -1
- package/dist/internal/NumericKey.js +19 -1
- package/dist/internal/NumericKey.js.map +1 -1
- package/dist/internal/ObjectKeyText.d.ts +29 -0
- package/dist/internal/ObjectKeyText.d.ts.map +1 -0
- package/dist/internal/ObjectKeyText.js +50 -0
- package/dist/internal/ObjectKeyText.js.map +1 -0
- package/dist/internal/OwnNames.d.ts +205 -0
- package/dist/internal/OwnNames.d.ts.map +1 -0
- package/dist/internal/OwnNames.js +415 -0
- package/dist/internal/OwnNames.js.map +1 -0
- package/dist/internal/PackedCodec.d.ts +7 -1
- package/dist/internal/PackedCodec.d.ts.map +1 -1
- package/dist/internal/PackedCodec.js +83 -21
- package/dist/internal/PackedCodec.js.map +1 -1
- package/dist/internal/RestoredKeyText.d.ts +10 -0
- package/dist/internal/RestoredKeyText.d.ts.map +1 -0
- package/dist/internal/RestoredKeyText.js +50 -0
- package/dist/internal/RestoredKeyText.js.map +1 -0
- package/dist/internal/SchemaAccessors.d.ts +280 -1
- package/dist/internal/SchemaAccessors.d.ts.map +1 -1
- package/dist/internal/SchemaAccessors.js +1717 -1
- package/dist/internal/SchemaAccessors.js.map +1 -1
- package/dist/internal/SchemaIssue.d.ts +21 -0
- package/dist/internal/SchemaIssue.d.ts.map +1 -0
- package/dist/internal/SchemaIssue.js +34 -0
- package/dist/internal/SchemaIssue.js.map +1 -0
- package/dist/internal/SharedKeyAttribute.d.ts +60 -6
- package/dist/internal/SharedKeyAttribute.d.ts.map +1 -1
- package/dist/internal/SharedKeyAttribute.js +129 -13
- package/dist/internal/SharedKeyAttribute.js.map +1 -1
- package/dist/internal/SparseKey.d.ts +46 -0
- package/dist/internal/SparseKey.d.ts.map +1 -0
- package/dist/internal/SparseKey.js +69 -0
- package/dist/internal/SparseKey.js.map +1 -0
- package/dist/internal/StoredForm.d.ts +139 -0
- package/dist/internal/StoredForm.d.ts.map +1 -0
- package/dist/internal/StoredForm.js +503 -0
- package/dist/internal/StoredForm.js.map +1 -0
- package/dist/internal/ZOrderCurve.d.ts.map +1 -1
- package/dist/internal/ZOrderCurve.js +2 -1
- package/dist/internal/ZOrderCurve.js.map +1 -1
- package/dist/internal/ZoneKeyText.d.ts +55 -0
- package/dist/internal/ZoneKeyText.d.ts.map +1 -0
- package/dist/internal/ZoneKeyText.js +264 -0
- package/dist/internal/ZoneKeyText.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal A sparse map's entries, as its writer and its reader take them: each entry is stored
|
|
3
|
+
* in an attribute of its own, named `<prefix>#<key>`.
|
|
4
|
+
*
|
|
5
|
+
* Every write of an entry runs {@link validateSparseKey}. Everything that decides which stored
|
|
6
|
+
* attributes belong to a sparse map (the row's reader, `clearMap`, `removeEntries`, a key attribute
|
|
7
|
+
* the map could name) asks {@link sparseReader}.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Validate a sparse-map key at write time.
|
|
11
|
+
*
|
|
12
|
+
* Rules:
|
|
13
|
+
* - Must be a string (we don't silently coerce).
|
|
14
|
+
* - Must be non-empty.
|
|
15
|
+
* - Must not contain `#` — `#` is reserved as the prefix/key delimiter.
|
|
16
|
+
* - The composed `<prefix>#<key>` must be 1–255 bytes. DynamoDB takes an attribute name of up to
|
|
17
|
+
* 64 KB, and 255 bytes only for an index key or an attribute an index projects by name; this
|
|
18
|
+
* is the library's own limit on an entry's name.
|
|
19
|
+
*
|
|
20
|
+
* Throws on violation. Caller is expected to translate into a tagged
|
|
21
|
+
* `ValidationError` at the entity boundary.
|
|
22
|
+
*/
|
|
23
|
+
export const validateSparseKey = (field, prefix, key) => {
|
|
24
|
+
if (typeof key !== "string") {
|
|
25
|
+
throw new Error(`Sparse map "${field}": key must be a string, got ${typeof key}`);
|
|
26
|
+
}
|
|
27
|
+
if (key.length === 0) {
|
|
28
|
+
throw new Error(`Sparse map "${field}": key must be non-empty`);
|
|
29
|
+
}
|
|
30
|
+
if (key.includes("#")) {
|
|
31
|
+
throw new Error(`Sparse map "${field}": key "${key}" must not contain '#' — the library does not silently escape`);
|
|
32
|
+
}
|
|
33
|
+
const attrName = `${prefix}#${key}`;
|
|
34
|
+
const byteLen = new TextEncoder().encode(attrName).length;
|
|
35
|
+
if (byteLen < 1 || byteLen > 255) {
|
|
36
|
+
throw new Error(`Sparse map "${field}": composed attribute name "${attrName}" is ${byteLen} bytes (must be 1–255)`);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
/** Why the sparse map's writer refuses `key` as an entry key ({@link validateSparseKey}), if it does. */
|
|
40
|
+
export const sparseKeyRefusal = (field, prefix, key) => {
|
|
41
|
+
try {
|
|
42
|
+
validateSparseKey(field, prefix, key);
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
return e instanceof Error ? e.message : String(e);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Which stored attributes are sparse map entries, as the reader reads a row: an attribute is an
|
|
51
|
+
* entry of the field whose `<prefix>#` begins it, the longest such prefix winning, when something
|
|
52
|
+
* follows that `#`; the rest is the entry's key. `<prefix>#` itself is no entry (the writer never
|
|
53
|
+
* writes an empty key). `fields` lists the sparse fields in reading order.
|
|
54
|
+
*/
|
|
55
|
+
export const sparseReader = (sparseFields) => {
|
|
56
|
+
const order = Object.entries(sparseFields)
|
|
57
|
+
.map(([field, { prefix }]) => ({ field, prefix, start: `${prefix}#` }))
|
|
58
|
+
.sort((a, b) => b.start.length - a.start.length);
|
|
59
|
+
return {
|
|
60
|
+
fields: order.map(({ field }) => field),
|
|
61
|
+
entryOf: (attribute) => {
|
|
62
|
+
const match = order.find(({ start }) => attribute.startsWith(start));
|
|
63
|
+
if (match === undefined || attribute.length === match.start.length)
|
|
64
|
+
return undefined;
|
|
65
|
+
return { field: match.field, prefix: match.prefix, key: attribute.slice(match.start.length) };
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=SparseKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SparseKey.js","sourceRoot":"","sources":["../../src/internal/SparseKey.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;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D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,YAAmE,EAInE,EAAE;IACF,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC;SACvC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC;SACtE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAClD,OAAO;QACL,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC;QACvC,OAAO,EAAE,CAAC,SAAS,EAAE,EAAE;YACrB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAA;YACpE,IAAI,KAAK,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,KAAK,CAAC,KAAK,CAAC,MAAM;gBAAE,OAAO,SAAS,CAAA;YACpF,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAA;QAC/F,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal What one of Effect's own instances is stored as, for packed storage to write.
|
|
3
|
+
*
|
|
4
|
+
* The marshaller stores a class instance as the map of its enumerable properties, its prototype's
|
|
5
|
+
* included, and a read rebuilds Effect's look-alikes from that map (`EffectInstances`). JSON has no
|
|
6
|
+
* instance, so packed storage refused one: a `Duration` in a packed struct, the same value a native
|
|
7
|
+
* attribute stores and reads back, couldn't be written at all. {@link storedFormOf} is that map, in
|
|
8
|
+
* the order DynamoDB Local hands it back, so an instance packs to the bytes the map read back from a
|
|
9
|
+
* native row packs to, as a real date always has ({@link storedDate}).
|
|
10
|
+
*
|
|
11
|
+
* The map is built as the marshaller builds it: each enumerable property, its prototype's included,
|
|
12
|
+
* without a function or `undefined`, and without a decimal's cached normalized form
|
|
13
|
+
* ({@link isCachedNormal}). Inside one of Effect's look-alikes, everything is the library's own data,
|
|
14
|
+
* so it's what the unmarshaller hands back: a bigint is the number it reads as while it's a safe
|
|
15
|
+
* integer, and a cookie's expiry is the ISO text a native write stores. What JSON still can't hold
|
|
16
|
+
* (binary, a bigint past 2^53, a `Date` anywhere else) is left in place, for the strict serialiser
|
|
17
|
+
* to refuse where it is. An `Option` or a `Result` holds the caller's value, which is packed by the
|
|
18
|
+
* rules every packed value is: only the map around it is built here.
|
|
19
|
+
*/
|
|
20
|
+
import { BigDecimal, DateTime } from "effect";
|
|
21
|
+
/** The marker a marshalled `DateTime` carries. */
|
|
22
|
+
export declare const DATE_MARKER = "~effect/DateTime";
|
|
23
|
+
/** The marker it carried on Effect's betas and early rcs. */
|
|
24
|
+
export declare const BETA_DATE_MARKER = "~effect/time/DateTime";
|
|
25
|
+
export declare const ZONE_MARKER = "~effect/DateTime/TimeZone";
|
|
26
|
+
export declare const BIG_DECIMAL_MARKER = "~effect/BigDecimal";
|
|
27
|
+
export declare const DURATION_MARKER = "~effect/Duration";
|
|
28
|
+
export declare const COOKIE_MARKER = "~effect/http/Cookies/Cookie";
|
|
29
|
+
export declare const COOKIES_MARKER = "~effect/http/Cookies";
|
|
30
|
+
export declare const URL_PARAMS_MARKER = "~effect/http/UrlParams";
|
|
31
|
+
export declare const SEMVER_MARKER = "~effect/SemVer";
|
|
32
|
+
export declare const SEMVER_RANGE_MARKER = "~effect/SemVerRange";
|
|
33
|
+
export declare const NET_ADDRESS_MARKER = "~effect/net/NetAddress";
|
|
34
|
+
export declare const IP_NETWORK_MARKER = "~effect/net/IpNetwork";
|
|
35
|
+
export declare const IP_INTERFACE_MARKER = "~effect/net/IpInterface";
|
|
36
|
+
export declare const HOST_MARKER = "~effect/net/Host";
|
|
37
|
+
export declare const DNS_RECORD_MARKER = "~effect/net/Dns/DnsRecord";
|
|
38
|
+
/** A `BigDecimal` itself, not the map DynamoDB hands back for one: its marker is on the prototype. */
|
|
39
|
+
export declare const isBigDecimalInstance: (value: object) => value is BigDecimal.BigDecimal;
|
|
40
|
+
/**
|
|
41
|
+
* Whether a decimal's cached `normalized` form leads into a cycle: the one `BigDecimal.normalize`
|
|
42
|
+
* caches holds itself, so following it never ends.
|
|
43
|
+
*/
|
|
44
|
+
export declare const cachesCycle: (decimal: BigDecimal.BigDecimal) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether a property of an object is a decimal's cached `normalized` form, which marshalling doesn't
|
|
47
|
+
* store: what compares two values as stored, and what packs one, leave it out too. Reads descriptors
|
|
48
|
+
* only, so no getter is called.
|
|
49
|
+
*/
|
|
50
|
+
export declare const isCachedNormal: (value: object, key: string) => boolean;
|
|
51
|
+
/** The prototype of Effect's own cookies. */
|
|
52
|
+
export declare const COOKIE_PROTO: object;
|
|
53
|
+
/**
|
|
54
|
+
* A cookie's expiry as a native write stores it: the ISO text of a valid `Date` marshalling would
|
|
55
|
+
* store as an empty map. `undefined` for anything else, which is stored as marshalling makes it.
|
|
56
|
+
*/
|
|
57
|
+
export declare const expiryText: (expires: unknown) => string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* The name a named zone is stored, keyed, compared and written in ISO text under, from what it holds:
|
|
60
|
+
* its `resolvedId` where it holds one as text, otherwise its `id`. The one decision on what names a
|
|
61
|
+
* zone; `undefined` for one holding neither as text.
|
|
62
|
+
*
|
|
63
|
+
* Effect 4.1.3 gave a named zone a `resolvedId`, the name its `Intl` formatter resolves it to, and
|
|
64
|
+
* kept the name it was made from as its `id` (`Etc/UTC`, resolved `UTC`). Up to 4.1.2 the `id` was
|
|
65
|
+
* that resolved name, and there was no `resolvedId`. So this is the resolved name on either Effect,
|
|
66
|
+
* for a zone made fresh or rebuilt from a stored map of either form, and two zones Effect holds equal
|
|
67
|
+
* (`Equal.equals`) have the same one: 4.1.3 compares `resolvedId` against `resolvedId ?? id`. It's
|
|
68
|
+
* the `id` 1.40.0 stored on 4.1.2. The resolved name is what the runtime's `Intl` makes of the name a
|
|
69
|
+
* zone was made from, so it is the runtime's: `Asia/Kolkata` is `Asia/Calcutta` on this one.
|
|
70
|
+
*/
|
|
71
|
+
export declare const storedZoneName: (id: unknown, resolvedId: unknown) => string | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* The `id` a named zone's map is written with where it holds a `resolvedId`, which the write leaves
|
|
74
|
+
* out ({@link storedZoneName}); `undefined` for any other map, written as it is. Every write of a zone
|
|
75
|
+
* takes it, from the entries it obtained: the map a native write marshalled, a packed one, a zone's
|
|
76
|
+
* own properties, a map that only looks like one. A map holding `resolvedId` was written on 4.1.3 by
|
|
77
|
+
* a release storing a zone as Effect held it; it is read as the zone it is, and written as 4.1.2 held
|
|
78
|
+
* it the next time the item is.
|
|
79
|
+
*/
|
|
80
|
+
export declare const rewrittenZoneId: (tag: unknown, id: unknown, resolvedId: unknown) => string | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Entries a write obtained of a map, with a named zone's written as {@link rewrittenZoneId} says:
|
|
83
|
+
* `id` under the resolved name, in its place, and no `resolvedId`. The same array when it isn't one.
|
|
84
|
+
* `isZone` says the map carries a zone's marker, its own or its prototype's.
|
|
85
|
+
*/
|
|
86
|
+
export declare const zoneEntriesWritten: <V>(entries: ReadonlyArray<readonly [string, V]>, isZone: boolean, text: (value: V) => unknown, named: (name: string) => V) => ReadonlyArray<readonly [string, V]>;
|
|
87
|
+
/** A named zone's name ({@link storedZoneName}), read from its own data: no getter is called. */
|
|
88
|
+
export declare const zoneNameOf: (zone: object) => string | undefined;
|
|
89
|
+
/** One of Effect's zones itself, not the map DynamoDB hands back for one: its marker is inherited. */
|
|
90
|
+
export declare const isZoneInstance: (value: object) => boolean;
|
|
91
|
+
/** A step into a `Set`'s element, or a `Map`'s key: nothing stored is reached by name there. */
|
|
92
|
+
export declare const UNNAMED_STEP: unique symbol;
|
|
93
|
+
/**
|
|
94
|
+
* Every value in a value, at any depth, each given as `leaf` returns it, with the path to it: the
|
|
95
|
+
* one walk every text naming a zone takes, so the key form ({@link zonesAsStored}), the sentinel
|
|
96
|
+
* text, what decides whether a value names a zone at all ({@link namesZone}) and `rekey`'s reading of
|
|
97
|
+
* the name a zone was given (`ZoneKeyText`) reach the same zones. A leaf is a zone itself, a
|
|
98
|
+
* primitive, a date in UTC, an empty `Option` or an object keeping its content in internal slots (a
|
|
99
|
+
* `Date`, a typed array), which isn't walked. Everything else is walked: a zoned date's zone (`zone`),
|
|
100
|
+
* an `Option`'s value (`value`), a `Result`'s (`success` / `failure`), a list or tuple (each index), a
|
|
101
|
+
* `Set` (each element, {@link UNNAMED_STEP}), a `Map` (each key, {@link UNNAMED_STEP}, and each
|
|
102
|
+
* value, under its key's text), a record or struct, and any other object's own properties (a `Schema.Class`
|
|
103
|
+
* instance, one of Effect's collections): every container a value's text can show a zone through,
|
|
104
|
+
* and the ones it can't, so a zone is named alike wherever a schema puts it. Each step is the name the
|
|
105
|
+
* marshaller stores what it reaches under. A property is read from its descriptor, so no getter is
|
|
106
|
+
* called, and what's behind one stays as it is. The same reference when `leaf` changes nothing in it;
|
|
107
|
+
* otherwise a copy, each container rebuilt as the kind it is, on its own prototype. An object met
|
|
108
|
+
* again inside itself is left as it is.
|
|
109
|
+
*/
|
|
110
|
+
export declare const walkLeaves: (value: unknown, leaf: (value: unknown, path: ReadonlyArray<PropertyKey>) => unknown) => unknown;
|
|
111
|
+
/** Whether a value is one of Effect's named zones itself. */
|
|
112
|
+
export declare const isNamedZone: (value: unknown) => value is DateTime.TimeZone.Named;
|
|
113
|
+
/**
|
|
114
|
+
* A value with each of Effect's named zones in it, at any depth ({@link walkLeaves}), under the name
|
|
115
|
+
* {@link storedZoneName} gives it, so its text is the text 4.1.2 gave it, and two values Effect holds
|
|
116
|
+
* equal have one text: a zone itself, a zoned date, a list of zones (`TimeZone.Named(UTC)`), an
|
|
117
|
+
* `Option`, a `Result` or a class instance whose text shows one. The same reference when nothing in it
|
|
118
|
+
* changes.
|
|
119
|
+
*/
|
|
120
|
+
export declare const zonesAsStored: (value: unknown) => unknown;
|
|
121
|
+
/** Whether a value holds a named zone anywhere {@link zonesAsStored} reaches one. */
|
|
122
|
+
export declare const namesZone: (value: unknown) => boolean;
|
|
123
|
+
/** A zoned date as ISO text with its zone's name, the name 4.1.2 gave it ({@link zonesAsStored}). */
|
|
124
|
+
export declare const zonedIsoText: (date: DateTime.Zoned) => string;
|
|
125
|
+
/**
|
|
126
|
+
* A map with its keys in the order DynamoDB Local hands a stored map back: by the bucket each lands
|
|
127
|
+
* in, and in the order written within one. Measured against every map published 1.39.0 stored for
|
|
128
|
+
* one of Effect's look-alikes. A key that's an array index comes first in any JavaScript object, and
|
|
129
|
+
* the unmarshaller's map is one, so it does here too.
|
|
130
|
+
*/
|
|
131
|
+
export declare const inStoredOrder: (entries: ReadonlyArray<readonly [string, unknown]>) => Record<string, unknown>;
|
|
132
|
+
/**
|
|
133
|
+
* What one of Effect's own instances is stored as, for packed storage to write: a date, one of the
|
|
134
|
+
* look-alikes a read rebuilds, an `Option` or a `Result`, as the map a native write stores, in the
|
|
135
|
+
* order DynamoDB Local hands it back. `undefined` for any other value, which packed storage refuses
|
|
136
|
+
* as it always has.
|
|
137
|
+
*/
|
|
138
|
+
export declare const storedFormOf: (value: object) => object | undefined;
|
|
139
|
+
//# sourceMappingURL=StoredForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoredForm.d.ts","sourceRoot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