@cratis/fundamentals 7.22.3 → 7.22.4
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/JsonSerializer.ts +36 -14
- package/dist/JsonSerializer.d.ts.map +1 -1
- package/dist/JsonSerializer.js +29 -9
- package/dist/JsonSerializer.js.map +1 -1
- package/dist/cjs/JsonSerializer.d.ts.map +1 -1
- package/dist/cjs/JsonSerializer.js +28 -8
- package/dist/cjs/JsonSerializer.js.map +1 -1
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/typeKey.d.ts +3 -0
- package/dist/cjs/typeKey.d.ts.map +1 -1
- package/dist/cjs/typeKey.js +6 -0
- package/dist/cjs/typeKey.js.map +1 -1
- package/dist/esm/JsonSerializer.d.ts.map +1 -1
- package/dist/esm/JsonSerializer.js +29 -9
- package/dist/esm/JsonSerializer.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/typeKey.d.ts +3 -0
- package/dist/esm/typeKey.d.ts.map +1 -1
- package/dist/esm/typeKey.js +4 -1
- package/dist/esm/typeKey.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typeKey.d.ts +3 -0
- package/dist/typeKey.d.ts.map +1 -1
- package/dist/typeKey.js +3 -0
- package/dist/typeKey.js.map +1 -1
- package/for_JsonSerializer/when_deserializing_a_value_map_with_c_sharp_written_negative_time_span_keys.ts +19 -0
- package/for_JsonSerializer/when_deserializing_a_value_map_with_c_sharp_written_time_only_keys.ts +19 -0
- package/for_JsonSerializer/when_deserializing_a_value_map_with_c_sharp_written_whole_second_time_span_keys.ts +19 -0
- package/for_JsonSerializer/when_deserializing_a_value_map_with_legacy_quoted_date_only_keys.ts +19 -0
- package/for_JsonSerializer/when_deserializing_a_value_map_with_legacy_quoted_time_only_keys.ts +19 -0
- package/for_JsonSerializer/when_deserializing_a_value_map_with_legacy_quoted_time_span_keys.ts +19 -0
- package/for_JsonSerializer/when_deserializing_a_value_map_with_malformed_date_only_keys.ts +20 -0
- package/for_JsonSerializer/when_deserializing_a_value_map_with_malformed_time_only_keys.ts +20 -0
- package/for_JsonSerializer/when_deserializing_a_value_map_with_malformed_time_span_keys.ts +20 -0
- package/for_JsonSerializer/when_round_tripping_a_value_map_with_date_only_keys.ts +26 -0
- package/for_JsonSerializer/when_round_tripping_a_value_map_with_time_only_keys.ts +26 -0
- package/for_JsonSerializer/when_round_tripping_a_value_map_with_time_span_keys.ts +26 -0
- package/package.json +1 -1
- package/typeKey.ts +9 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonSerializer.js","sources":["../../JsonSerializer.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Constructor } from './Constructor';\nimport { DerivedType } from './DerivedType';\nimport { registerModuleInstance } from './duplicateInstanceGuard';\nimport { Field } from './Field';\nimport { Fields } from './Fields';\nimport { Guid } from './Guid';\nimport { conceptAsTypeKey, declaredTypeKey, guidTypeKey, typeKeyOf, valueMapTypeKey } from './typeKey';\nimport { ValueMap } from './ValueMap';\nimport { \n JsonConverter, \n DateJsonConverter, \n DateOnlyJsonConverter,\n GuidJsonConverter, \n TimeOnlyJsonConverter,\n TimeSpanJsonConverter, \n PointJsonConverter,\n LineStringJsonConverter,\n PolygonJsonConverter,\n ValueMapJsonConverter\n} from './json';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\ntype typeSerializer = (value: any) => any;\n\n// A second copy of this package in the same realm builds its own registry here, and brings its own\n// class objects. Convertible values still cross between the copies, because a type is recognized by\n// the key it declares - but a converter registered on one copy reaches only that one, and a version\n// pinned at the top level never reaches a nested copy. Announce it where the state that cannot be\n// shared is built.\nregisterModuleInstance();\n\n// Initialize converters\nconst converters: JsonConverter[] = [\n new DateJsonConverter(),\n new DateOnlyJsonConverter(),\n new GuidJsonConverter(),\n new TimeOnlyJsonConverter(),\n new TimeSpanJsonConverter(),\n new PointJsonConverter(),\n new LineStringJsonConverter(),\n new PolygonJsonConverter(),\n new ValueMapJsonConverter()\n];\n\n// Converters are found by the key a type declares, and only by the constructor when it declares none.\n// Keying on the constructor alone is what made a second copy of this package silently fatal: each copy\n// brings its own Guid, ConceptAs and ValueMap class objects, so neither recognized the other's. A key\n// crosses that boundary; a class object does not. A consumer's own type has no key and is found by\n// constructor, which is exact and needs nothing to cross.\nconst keyedConverters: Map<string, JsonConverter> = new Map<string, JsonConverter>();\nconst typeConverters: Map<Constructor, JsonConverter> = new Map<Constructor, JsonConverter>();\n\nconst registerConverterFor = (converter: JsonConverter) => {\n const key = declaredTypeKey(converter.type);\n if (key !== undefined) {\n keyedConverters.set(key, converter);\n }\n\n typeConverters.set(converter.type, converter);\n};\n\nconverters.forEach(registerConverterFor);\n\n/**\n * Finds the converter registered for a type, if any.\n * @param {Constructor} type The type to convert.\n * @returns {JsonConverter | undefined} The converter, or undefined when the type has none.\n */\nconst converterFor = (type: Constructor | undefined): JsonConverter | undefined => {\n if (!type) return undefined;\n\n const key = declaredTypeKey(type);\n const keyed = key === undefined ? undefined : keyedConverters.get(key);\n return keyed ?? typeConverters.get(type);\n};\n\n/**\n * Checks whether a type is a ValueMap, including one from another copy of this package.\n * @param {Constructor} type The type to check.\n * @returns {boolean} True when the type is a ValueMap.\n */\nconst isValueMap = (type: Constructor | undefined): boolean => declaredTypeKey(type) === valueMapTypeKey;\n\n// Add primitive type converters that don't need a full JsonConverter class\nconst primitiveConverters: Map<Constructor, typeSerializer> = new Map<Constructor, typeSerializer>([\n [Number, (value: number) => value],\n [String, (value: string) => value],\n [Boolean, (value: boolean) => value]\n]);\n\nconst primitiveSerializers: Map<Constructor, typeSerializer> = new Map<Constructor, typeSerializer>([\n [Number, (value: any) => value],\n [String, (value: any) => value],\n [Boolean, (value: any) => value]\n]);\n\n/**\n * Checks if a constructor is a ConceptAs type.\n * @param {Constructor} type The constructor to check.\n * @returns {boolean} True if the type extends ConceptAs.\n * @remarks\n * Reads the key rather than walking the prototype chain looking for this copy's ConceptAs. The key is a\n * static and a static is inherited, so every type deriving from ConceptAs carries it - including one\n * deriving from another copy's ConceptAs, which a prototype walk could never recognize.\n */\nconst isConceptAs = (type: Constructor): boolean => typeKeyOf(type) === conceptAsTypeKey;\n\nconst serializeValueForType = (type: Constructor, value: any) => {\n if (!value) return value;\n\n // If it's a ConceptAs instance, unwrap it and serialize the inner value recursively\n // This follows the C# pattern: recognize as concept, unwrap, then call serializer\n if (isConceptAs(value.constructor)) {\n const innerValue = value.value;\n // Recursively serialize the inner value to handle complex types\n // Use .constructor directly which works reliably for both primitives and objects\n return serializeValueForType(innerValue.constructor, innerValue);\n }\n\n // Check if there's a registered converter\n const converter = converterFor(type);\n if (converter) {\n return converter.write(value);\n }\n \n // Check primitive converters\n if (primitiveConverters.has(type)) {\n return primitiveConverters.get(type)!(value);\n }\n \n return convertTypesOnInstance(value);\n};\n\nconst deserializeValueFromType = (type: Constructor, value: any) => {\n // If it's a ConceptAs type, instantiate it with the value\n if (isConceptAs(type)) {\n const valueType = (type as Constructor & { valueType?: Constructor }).valueType;\n return new type(valueType ? deserializeValueFromType(valueType, value) : value);\n }\n \n // Check if there's a registered converter\n const converter = converterFor(type);\n if (converter) {\n return converter.read(value);\n }\n \n // Check primitive serializers\n if (primitiveSerializers.has(type)) {\n return primitiveSerializers.get(type)!(value);\n }\n \n return JsonSerializer.deserialize(type, JSON.stringify(value));\n};\n\nconst deserializeValueFromField = (field: Field, value: any) => {\n if (isValueMap(field.type)) {\n return deserializeValueMapFromField(field, value);\n }\n\n // If it's a ConceptAs type, instantiate it with the value\n if (isConceptAs(field.type)) {\n return deserializeValueFromType(field.type, value);\n }\n\n // Check if there's a registered converter\n const converter = converterFor(field.type);\n if (converter) {\n return converter.read(value);\n }\n \n // Check primitive serializers\n if (primitiveSerializers.has(field.type)) {\n return primitiveSerializers.get(field.type)!(value);\n }\n \n let type = field.type;\n if (value[JsonSerializer.DerivedTypeIdProperty]) {\n const derivedTypeId = value[JsonSerializer.DerivedTypeIdProperty];\n const candidates = [...field.derivatives, ...DerivedType.getDerivedTypesFor(field.type)];\n type = candidates.find(_ => DerivedType.get(_) == derivedTypeId) || type;\n }\n\n return JsonSerializer.deserialize(type, JSON.stringify(value));\n};\n\nconst serializeMapKey = (key: any): string => {\n if (key === undefined || key === null) {\n return '';\n }\n\n if (typeof key === 'string') {\n return key;\n }\n\n if (typeof key === 'number' || typeof key === 'boolean' || typeof key === 'bigint') {\n return key.toString();\n }\n\n if (key instanceof Date) {\n return key.toISOString();\n }\n\n // A Guid key is its plain canonical string, which is what a C# dictionary writes. Serializing it\n // like any other object would wrap it in JSON quotes and no other reader accepts that.\n if (declaredTypeKey(key.constructor) === guidTypeKey) {\n return key.toString();\n }\n\n return JsonSerializer.serialize(key);\n};\n\nconst readGuidMapKey = (key: string): Guid => {\n // Keys written before the plain form was adopted carry the JSON quotes of an embedded string.\n const text = key.length >= 2 && key.startsWith('\"') && key.endsWith('\"') ? key.slice(1, -1) : key;\n if (!Guid.isGuid(text)) {\n throw new Error(`The map key '${key}' is not a valid Guid.`);\n }\n\n return Guid.parse(text);\n};\n\nconst deserializeMapKey = (keyType: Constructor, key: string): any => {\n if (keyType === String) {\n return key;\n }\n\n if (keyType === Number) {\n return Number(key);\n }\n\n if (keyType === Boolean) {\n return key.toLowerCase() === 'true';\n }\n\n if (declaredTypeKey(keyType) === guidTypeKey) {\n return readGuidMapKey(key);\n }\n\n // Check if there's a converter for this type\n const converter = converterFor(keyType);\n if (converter) {\n return converter.read(key);\n }\n\n return JsonSerializer.deserialize(keyType, key);\n};\n\nconst deserializeMapValue = (valueType: Constructor | undefined, value: any): any => {\n if (!valueType) {\n return value;\n }\n\n // A map value is an ordinary value of its declared type, so read it the way any other value of that\n // type is read. Resolving it here instead left out the concept and primitive cases, and the\n // primitive one lost data without a sound: a string value went through JsonSerializer.deserialize,\n // which built an empty String object because a primitive has no fields to populate.\n return deserializeValueFromType(valueType, value);\n};\n\nconst deserializeValueMapFromField = (field: Field, value: any): ValueMap<any, any> => {\n const valueMap = new ValueMap<any, any>();\n const keyType = field.genericArguments[0];\n const valueType = field.genericArguments[1];\n\n if (!value || !keyType) {\n return valueMap;\n }\n\n for (const key of Object.keys(value)) {\n const deserializedKey = deserializeMapKey(keyType, key);\n const deserializedValue = deserializeMapValue(valueType, value[key]);\n valueMap.set(deserializedKey, deserializedValue);\n }\n\n return valueMap;\n};\n\nconst convertTypesOnInstance = (instance: any) => {\n // A concept unwraps to its underlying value wherever it is reached, not only when it is reached\n // through a declared field. An array element and a map value arrive here rather than at\n // serializeValueForType, and without this they were written as the object a concept happens to be -\n // {\"value\": ...} where the receiver declared the underlying type.\n if (isConceptAs(instance.constructor)) {\n return serializeValueForType(instance.constructor as Constructor, instance);\n }\n\n // Check if there's a converter for this type\n if (converterFor(instance.constructor)) {\n return serializeValueForType(instance.constructor, instance);\n }\n \n // Check primitive converters\n if (primitiveConverters.has(instance.constructor)) {\n return primitiveConverters.get(instance.constructor)!(instance);\n }\n\n const properties = Object.getOwnPropertyNames(instance);\n const converted: any = {};\n\n // Emit the polymorphic type discriminator, preferring the registered type for the instance's\n // constructor and falling back to a discriminator preserved on the instance itself (e.g. a value\n // that was deserialized before its concrete type could be resolved). This keeps '_derivedTypeId'\n // flowing through serialization transparently — the caller never has to manage it — and is the\n // mirror of preserving it on deserialization.\n const derivedTypeId = DerivedType.get(instance.constructor) ?? instance[JsonSerializer.DerivedTypeIdProperty];\n if (derivedTypeId) {\n converted[JsonSerializer.DerivedTypeIdProperty] = derivedTypeId;\n }\n properties.forEach(property => {\n // The discriminator is handled above as a meta-property; never treat it as a data field.\n if (property === JsonSerializer.DerivedTypeIdProperty) return;\n let value = instance[property];\n if (value !== undefined) {\n if (Array.isArray(value)) {\n value = value.map(_ => convertTypesOnInstance(_));\n } else {\n value = serializeValueForType(value.__proto__.constructor, value);\n }\n }\n\n converted[property] = value;\n });\n\n return converted;\n};\n\n// Initialize ValueMapJsonConverter with helper functions to avoid circular dependencies\n// Must be done after serializeMapKey and convertTypesOnInstance are defined\nValueMapJsonConverter.setHelpers(serializeMapKey, convertTypesOnInstance);\n\n/**\n * Represents a serializer for JSON.\n */\nexport class JsonSerializer {\n static readonly DerivedTypeIdProperty: string = \"_derivedTypeId\";\n\n /**\n * Register a converter for the type it declares through its `type` property.\n * @param {JsonConverter} converter The converter to register.\n * @remarks\n * The converter is used for both directions - `read` on the way in, `write` on the way out - and\n * takes the place of any converter already registered for the same type, including the built-in\n * ones. Replacing a built-in changes the payloads the application produces and consumes, which is\n * the caller's to decide; nothing here second-guesses it.\n *\n * Two shapes resolve ahead of the converters, so a converter registered for them is not reached:\n *\n * - A type deriving from `ConceptAs` is unwrapped to its underlying value in both directions, and\n * converted as that value's type. Register for the underlying type to reach a concept.\n * - A `ValueMap` is read back from the declaring field's generic arguments rather than through a\n * converter. Note the asymmetry: writing a `ValueMap` *does* go through the registered converter,\n * so replacing that one changes only the outbound half.\n * - A `Guid` used as a `ValueMap` key always uses the plain canonical string form and bypasses any\n * registered `Guid` converter, so that keys stay compatible with C# dictionaries.\n */\n static registerConverter(converter: JsonConverter): void {\n registerConverterFor(converter);\n }\n\n /**\n * Serialize with strong type information.\n * @param {*} value The value to serialize.\n * @returns A JSON string.\n */\n static serialize(value: any): string {\n const converted = convertTypesOnInstance(value);\n return JSON.stringify(converted);\n }\n\n /**\n * Deserialize a JSON string to the specific type.\n * @param {Constructor} targetType Type to deserialize to.\n * @param {string} json Actual JSON to deserialize.\n * @returns An instance of the target type.\n */\n static deserialize<TResult extends object>(targetType: Constructor<TResult>, json: string): TResult {\n const parsed = JSON.parse(json);\n return this.deserializeFromInstance<TResult>(targetType, parsed);\n }\n\n /**\n * Deserialize a array JSON string to an array of the specific instance type.\n * @param {Constructor} targetType Type to deserialize to.\n * @param {string} json Actual JSON to deserialize.\n * @returns An array of instances of the target type.\n */\n static deserializeArray<TResult extends object>(targetType: Constructor<TResult>, json: string): TResult[] {\n const parsed = JSON.parse(json);\n return this.deserializeArrayFromInstance(targetType, parsed);\n }\n\n /**\n * Deserialize an any instance to a specific instance type.\n * @param {Constructor} targetType Type to deserialize to.\n * @param {*} instance Actual instance to deserialize.\n * @returns An instance of the target type.\n */\n static deserializeFromInstance<TResult extends object>(targetType: Constructor<TResult>, instance: any): TResult {\n const fields = Fields.getFieldsForType(targetType as Constructor);\n\n if (converterFor(targetType) || isConceptAs(targetType)) {\n return deserializeValueFromType(targetType, instance);\n }\n\n const deserialized = new targetType();\n for (const field of fields) {\n let value = instance[field.name];\n if (value !== undefined && value !== null) {\n if (field.type === Array) {\n const elementType = field.genericArguments[0];\n if (elementType) {\n const elementField = new Field(field.name, elementType, false, field.derivatives, []);\n value = value.map(_ => deserializeValueFromField(elementField, _));\n }\n } else if (field.enumerable) {\n value = value.map(_ => deserializeValueFromField(field, _));\n } else {\n value = deserializeValueFromField(field, value);\n }\n } else if ((field.enumerable || field.type === Array) && value === undefined) {\n // A collection that is absent from the payload deserializes to an empty one rather than to\n // undefined. The declared type says the field is an array, and a producer that leaves an\n // empty collection out - which the Chronicle sink does deliberately, so that a parallel\n // replay cannot overwrite children a sibling event already wrote - would otherwise hand back\n // a value contradicting its own type, putting a null guard on every reader of every\n // collection. An explicit null is left alone: that is the producer saying \"no collection\"\n // rather than \"an empty one\".\n value = [];\n }\n\n deserialized[field.name] = value;\n }\n\n // Preserve the polymorphic type discriminator so it is never lost across (de)serialization\n // layers. '_derivedTypeId' is not a declared field, so it is otherwise dropped here — and a\n // derived value whose concrete type could not be resolved (e.g. its type was not yet\n // registered) would then have no discriminator left to re-resolve or round-trip with, and\n // would serialize back with no type information at all.\n const derivedTypeId = instance[JsonSerializer.DerivedTypeIdProperty];\n if (derivedTypeId !== undefined && derivedTypeId !== null) {\n (deserialized as Record<string, unknown>)[JsonSerializer.DerivedTypeIdProperty] = derivedTypeId;\n }\n\n if ((targetType as Constructor) == Object) {\n const objectFields = Object.keys(instance).filter((value) => {\n return !fields.some(_ => _.name == value);\n });\n\n for (const field of objectFields) {\n deserialized[field] = instance[field];\n }\n }\n\n return deserialized;\n }\n\n /**\n * Deserialize an array of any instances to an array of specific instance types.\n * @param {Constructor} targetType Type to deserialize to.\n * @param {instances} instances Actual instances to deserialize.\n * @returns An array of instances of the target type.\n */\n static deserializeArrayFromInstance<TResult extends object>(targetType: Constructor<TResult>, instances: any): TResult[] {\n const deserialized: TResult[] = [];\n\n for (const instance of instances) {\n deserialized.push(this.deserializeFromInstance<TResult>(targetType, instance));\n }\n\n return deserialized;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAiCA,sBAAsB,EAAE;AAGxB,MAAM,UAAU,GAAoB;AAChC,IAAA,IAAI,iBAAiB,EAAE;AACvB,IAAA,IAAI,qBAAqB,EAAE;AAC3B,IAAA,IAAI,iBAAiB,EAAE;AACvB,IAAA,IAAI,qBAAqB,EAAE;AAC3B,IAAA,IAAI,qBAAqB,EAAE;AAC3B,IAAA,IAAI,kBAAkB,EAAE;AACxB,IAAA,IAAI,uBAAuB,EAAE;AAC7B,IAAA,IAAI,oBAAoB,EAAE;AAC1B,IAAA,IAAI,qBAAqB;CAC5B;AAOD,MAAM,eAAe,GAA+B,IAAI,GAAG,EAAyB;AACpF,MAAM,cAAc,GAAoC,IAAI,GAAG,EAA8B;AAE7F,MAAM,oBAAoB,GAAG,CAAC,SAAwB,KAAI;IACtD,MAAM,GAAG,GAAG,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC;AAC3C,IAAA,IAAI,GAAG,KAAK,SAAS,EAAE;AACnB,QAAA,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC;IACvC;IAEA,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC;AACjD,CAAC;AAED,UAAU,CAAC,OAAO,CAAC,oBAAoB,CAAC;AAOxC,MAAM,YAAY,GAAG,CAAC,IAA6B,KAA+B;AAC9E,IAAA,IAAI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,KAAK,CAAC;YACzC;QACJ;AAEA,QAAA,OAAO,YAAY;IACvB;AAQA,IAAA,OAAO,4BAA4B,CAAyB,UAAgC,EAAE,SAAc,EAAA;QACxG,MAAM,YAAY,GAAc,EAAE;AAElC,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAC9B,YAAA,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAU,UAAU,EAAE,QAAQ,CAAC,CAAC;QAClF;AAEA,QAAA,OAAO,YAAY;IACvB;;;"}
|
|
1
|
+
{"version":3,"file":"JsonSerializer.js","sources":["../../JsonSerializer.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Constructor } from './Constructor';\nimport { DerivedType } from './DerivedType';\nimport { registerModuleInstance } from './duplicateInstanceGuard';\nimport { Field } from './Field';\nimport { Fields } from './Fields';\nimport { Guid } from './Guid';\nimport { DateOnly } from './DateOnly';\nimport { TimeOnly } from './TimeOnly';\nimport { TimeSpan } from './TimeSpan';\nimport { conceptAsTypeKey, dateOnlyTypeKey, declaredTypeKey, guidTypeKey, timeOnlyTypeKey, timeSpanTypeKey, typeKeyOf, valueMapTypeKey } from './typeKey';\nimport { ValueMap } from './ValueMap';\nimport { \n JsonConverter, \n DateJsonConverter, \n DateOnlyJsonConverter,\n GuidJsonConverter, \n TimeOnlyJsonConverter,\n TimeSpanJsonConverter, \n PointJsonConverter,\n LineStringJsonConverter,\n PolygonJsonConverter,\n ValueMapJsonConverter\n} from './json';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\ntype typeSerializer = (value: any) => any;\n\n// A second copy of this package in the same realm builds its own registry here, and brings its own\n// class objects. Convertible values still cross between the copies, because a type is recognized by\n// the key it declares - but a converter registered on one copy reaches only that one, and a version\n// pinned at the top level never reaches a nested copy. Announce it where the state that cannot be\n// shared is built.\nregisterModuleInstance();\n\n// Initialize converters\nconst converters: JsonConverter[] = [\n new DateJsonConverter(),\n new DateOnlyJsonConverter(),\n new GuidJsonConverter(),\n new TimeOnlyJsonConverter(),\n new TimeSpanJsonConverter(),\n new PointJsonConverter(),\n new LineStringJsonConverter(),\n new PolygonJsonConverter(),\n new ValueMapJsonConverter()\n];\n\n// Converters are found by the key a type declares, and only by the constructor when it declares none.\n// Keying on the constructor alone is what made a second copy of this package silently fatal: each copy\n// brings its own Guid, ConceptAs and ValueMap class objects, so neither recognized the other's. A key\n// crosses that boundary; a class object does not. A consumer's own type has no key and is found by\n// constructor, which is exact and needs nothing to cross.\nconst keyedConverters: Map<string, JsonConverter> = new Map<string, JsonConverter>();\nconst typeConverters: Map<Constructor, JsonConverter> = new Map<Constructor, JsonConverter>();\n\nconst registerConverterFor = (converter: JsonConverter) => {\n const key = declaredTypeKey(converter.type);\n if (key !== undefined) {\n keyedConverters.set(key, converter);\n }\n\n typeConverters.set(converter.type, converter);\n};\n\nconverters.forEach(registerConverterFor);\n\n/**\n * Finds the converter registered for a type, if any.\n * @param {Constructor} type The type to convert.\n * @returns {JsonConverter | undefined} The converter, or undefined when the type has none.\n */\nconst converterFor = (type: Constructor | undefined): JsonConverter | undefined => {\n if (!type) return undefined;\n\n const key = declaredTypeKey(type);\n const keyed = key === undefined ? undefined : keyedConverters.get(key);\n return keyed ?? typeConverters.get(type);\n};\n\n/**\n * Checks whether a type is a ValueMap, including one from another copy of this package.\n * @param {Constructor} type The type to check.\n * @returns {boolean} True when the type is a ValueMap.\n */\nconst isValueMap = (type: Constructor | undefined): boolean => declaredTypeKey(type) === valueMapTypeKey;\n\n// Add primitive type converters that don't need a full JsonConverter class\nconst primitiveConverters: Map<Constructor, typeSerializer> = new Map<Constructor, typeSerializer>([\n [Number, (value: number) => value],\n [String, (value: string) => value],\n [Boolean, (value: boolean) => value]\n]);\n\nconst primitiveSerializers: Map<Constructor, typeSerializer> = new Map<Constructor, typeSerializer>([\n [Number, (value: any) => value],\n [String, (value: any) => value],\n [Boolean, (value: any) => value]\n]);\n\n/**\n * Checks if a constructor is a ConceptAs type.\n * @param {Constructor} type The constructor to check.\n * @returns {boolean} True if the type extends ConceptAs.\n * @remarks\n * Reads the key rather than walking the prototype chain looking for this copy's ConceptAs. The key is a\n * static and a static is inherited, so every type deriving from ConceptAs carries it - including one\n * deriving from another copy's ConceptAs, which a prototype walk could never recognize.\n */\nconst isConceptAs = (type: Constructor): boolean => typeKeyOf(type) === conceptAsTypeKey;\n\nconst serializeValueForType = (type: Constructor, value: any) => {\n if (!value) return value;\n\n // If it's a ConceptAs instance, unwrap it and serialize the inner value recursively\n // This follows the C# pattern: recognize as concept, unwrap, then call serializer\n if (isConceptAs(value.constructor)) {\n const innerValue = value.value;\n // Recursively serialize the inner value to handle complex types\n // Use .constructor directly which works reliably for both primitives and objects\n return serializeValueForType(innerValue.constructor, innerValue);\n }\n\n // Check if there's a registered converter\n const converter = converterFor(type);\n if (converter) {\n return converter.write(value);\n }\n \n // Check primitive converters\n if (primitiveConverters.has(type)) {\n return primitiveConverters.get(type)!(value);\n }\n \n return convertTypesOnInstance(value);\n};\n\nconst deserializeValueFromType = (type: Constructor, value: any) => {\n // If it's a ConceptAs type, instantiate it with the value\n if (isConceptAs(type)) {\n const valueType = (type as Constructor & { valueType?: Constructor }).valueType;\n return new type(valueType ? deserializeValueFromType(valueType, value) : value);\n }\n \n // Check if there's a registered converter\n const converter = converterFor(type);\n if (converter) {\n return converter.read(value);\n }\n \n // Check primitive serializers\n if (primitiveSerializers.has(type)) {\n return primitiveSerializers.get(type)!(value);\n }\n \n return JsonSerializer.deserialize(type, JSON.stringify(value));\n};\n\nconst deserializeValueFromField = (field: Field, value: any) => {\n if (isValueMap(field.type)) {\n return deserializeValueMapFromField(field, value);\n }\n\n // If it's a ConceptAs type, instantiate it with the value\n if (isConceptAs(field.type)) {\n return deserializeValueFromType(field.type, value);\n }\n\n // Check if there's a registered converter\n const converter = converterFor(field.type);\n if (converter) {\n return converter.read(value);\n }\n \n // Check primitive serializers\n if (primitiveSerializers.has(field.type)) {\n return primitiveSerializers.get(field.type)!(value);\n }\n \n let type = field.type;\n if (value[JsonSerializer.DerivedTypeIdProperty]) {\n const derivedTypeId = value[JsonSerializer.DerivedTypeIdProperty];\n const candidates = [...field.derivatives, ...DerivedType.getDerivedTypesFor(field.type)];\n type = candidates.find(_ => DerivedType.get(_) == derivedTypeId) || type;\n }\n\n return JsonSerializer.deserialize(type, JSON.stringify(value));\n};\n\nconst serializeMapKey = (key: any): string => {\n if (key === undefined || key === null) {\n return '';\n }\n\n if (typeof key === 'string') {\n return key;\n }\n\n if (typeof key === 'number' || typeof key === 'boolean' || typeof key === 'bigint') {\n return key.toString();\n }\n\n if (key instanceof Date) {\n return key.toISOString();\n }\n\n // Guid, DateOnly, TimeOnly and TimeSpan keys are their plain canonical strings, as a C# dictionary\n // writes them, rather than the quoted JSON string the generic path would produce.\n if (plainStringMapKeyTypes.has(declaredTypeKey(key.constructor) ?? '')) {\n return key.toString();\n }\n\n return JsonSerializer.serialize(key);\n};\n\nconst plainStringMapKeyTypes = new Map<string, { name: string; parse: (text: string) => any }>([\n [guidTypeKey, {\n name: 'Guid',\n parse: text => {\n if (!Guid.isGuid(text)) {\n throw new Error('Not a Guid.');\n }\n return Guid.parse(text);\n }\n }],\n [dateOnlyTypeKey, { name: 'DateOnly', parse: DateOnly.parse }],\n [timeOnlyTypeKey, { name: 'TimeOnly', parse: TimeOnly.parse }],\n [timeSpanTypeKey, { name: 'TimeSpan', parse: TimeSpan.parse }]\n]);\n\nconst unquoteLegacyMapKey = (key: string): string =>\n // Keys written before the plain form was adopted carry the JSON quotes of an embedded string.\n key.length >= 2 && key.startsWith('\"') && key.endsWith('\"') ? key.slice(1, -1) : key;\n\nconst readPlainStringMapKey = (name: string, parse: (text: string) => any, key: string): any => {\n try {\n return parse(unquoteLegacyMapKey(key));\n } catch {\n throw new Error(`The map key '${key}' is not a valid ${name}.`);\n }\n};\n\nconst deserializeMapKey = (keyType: Constructor, key: string): any => {\n if (keyType === String) {\n return key;\n }\n\n if (keyType === Number) {\n return Number(key);\n }\n\n if (keyType === Boolean) {\n return key.toLowerCase() === 'true';\n }\n\n const plainKeyType = plainStringMapKeyTypes.get(declaredTypeKey(keyType) ?? '');\n if (plainKeyType) {\n return readPlainStringMapKey(plainKeyType.name, plainKeyType.parse, key);\n }\n\n // Check if there's a converter for this type\n const converter = converterFor(keyType);\n if (converter) {\n return converter.read(key);\n }\n\n return JsonSerializer.deserialize(keyType, key);\n};\n\nconst deserializeMapValue = (valueType: Constructor | undefined, value: any): any => {\n if (!valueType) {\n return value;\n }\n\n // A map value is an ordinary value of its declared type, so read it the way any other value of that\n // type is read. Resolving it here instead left out the concept and primitive cases, and the\n // primitive one lost data without a sound: a string value went through JsonSerializer.deserialize,\n // which built an empty String object because a primitive has no fields to populate.\n return deserializeValueFromType(valueType, value);\n};\n\nconst deserializeValueMapFromField = (field: Field, value: any): ValueMap<any, any> => {\n const valueMap = new ValueMap<any, any>();\n const keyType = field.genericArguments[0];\n const valueType = field.genericArguments[1];\n\n if (!value || !keyType) {\n return valueMap;\n }\n\n for (const key of Object.keys(value)) {\n const deserializedKey = deserializeMapKey(keyType, key);\n const deserializedValue = deserializeMapValue(valueType, value[key]);\n valueMap.set(deserializedKey, deserializedValue);\n }\n\n return valueMap;\n};\n\nconst convertTypesOnInstance = (instance: any) => {\n // A concept unwraps to its underlying value wherever it is reached, not only when it is reached\n // through a declared field. An array element and a map value arrive here rather than at\n // serializeValueForType, and without this they were written as the object a concept happens to be -\n // {\"value\": ...} where the receiver declared the underlying type.\n if (isConceptAs(instance.constructor)) {\n return serializeValueForType(instance.constructor as Constructor, instance);\n }\n\n // Check if there's a converter for this type\n if (converterFor(instance.constructor)) {\n return serializeValueForType(instance.constructor, instance);\n }\n \n // Check primitive converters\n if (primitiveConverters.has(instance.constructor)) {\n return primitiveConverters.get(instance.constructor)!(instance);\n }\n\n const properties = Object.getOwnPropertyNames(instance);\n const converted: any = {};\n\n // Emit the polymorphic type discriminator, preferring the registered type for the instance's\n // constructor and falling back to a discriminator preserved on the instance itself (e.g. a value\n // that was deserialized before its concrete type could be resolved). This keeps '_derivedTypeId'\n // flowing through serialization transparently — the caller never has to manage it — and is the\n // mirror of preserving it on deserialization.\n const derivedTypeId = DerivedType.get(instance.constructor) ?? instance[JsonSerializer.DerivedTypeIdProperty];\n if (derivedTypeId) {\n converted[JsonSerializer.DerivedTypeIdProperty] = derivedTypeId;\n }\n properties.forEach(property => {\n // The discriminator is handled above as a meta-property; never treat it as a data field.\n if (property === JsonSerializer.DerivedTypeIdProperty) return;\n let value = instance[property];\n if (value !== undefined) {\n if (Array.isArray(value)) {\n value = value.map(_ => convertTypesOnInstance(_));\n } else {\n value = serializeValueForType(value.__proto__.constructor, value);\n }\n }\n\n converted[property] = value;\n });\n\n return converted;\n};\n\n// Initialize ValueMapJsonConverter with helper functions to avoid circular dependencies\n// Must be done after serializeMapKey and convertTypesOnInstance are defined\nValueMapJsonConverter.setHelpers(serializeMapKey, convertTypesOnInstance);\n\n/**\n * Represents a serializer for JSON.\n */\nexport class JsonSerializer {\n static readonly DerivedTypeIdProperty: string = \"_derivedTypeId\";\n\n /**\n * Register a converter for the type it declares through its `type` property.\n * @param {JsonConverter} converter The converter to register.\n * @remarks\n * The converter is used for both directions - `read` on the way in, `write` on the way out - and\n * takes the place of any converter already registered for the same type, including the built-in\n * ones. Replacing a built-in changes the payloads the application produces and consumes, which is\n * the caller's to decide; nothing here second-guesses it.\n *\n * Two shapes resolve ahead of the converters, so a converter registered for them is not reached:\n *\n * - A type deriving from `ConceptAs` is unwrapped to its underlying value in both directions, and\n * converted as that value's type. Register for the underlying type to reach a concept.\n * - A `ValueMap` is read back from the declaring field's generic arguments rather than through a\n * converter. Note the asymmetry: writing a `ValueMap` *does* go through the registered converter,\n * so replacing that one changes only the outbound half.\n * - A `Guid`, `DateOnly`, `TimeOnly` or `TimeSpan` used as a `ValueMap` key always uses the plain\n * canonical string form and bypasses any registered converter for that type, so that keys stay\n * compatible with C# dictionaries.\n */\n static registerConverter(converter: JsonConverter): void {\n registerConverterFor(converter);\n }\n\n /**\n * Serialize with strong type information.\n * @param {*} value The value to serialize.\n * @returns A JSON string.\n */\n static serialize(value: any): string {\n const converted = convertTypesOnInstance(value);\n return JSON.stringify(converted);\n }\n\n /**\n * Deserialize a JSON string to the specific type.\n * @param {Constructor} targetType Type to deserialize to.\n * @param {string} json Actual JSON to deserialize.\n * @returns An instance of the target type.\n */\n static deserialize<TResult extends object>(targetType: Constructor<TResult>, json: string): TResult {\n const parsed = JSON.parse(json);\n return this.deserializeFromInstance<TResult>(targetType, parsed);\n }\n\n /**\n * Deserialize a array JSON string to an array of the specific instance type.\n * @param {Constructor} targetType Type to deserialize to.\n * @param {string} json Actual JSON to deserialize.\n * @returns An array of instances of the target type.\n */\n static deserializeArray<TResult extends object>(targetType: Constructor<TResult>, json: string): TResult[] {\n const parsed = JSON.parse(json);\n return this.deserializeArrayFromInstance(targetType, parsed);\n }\n\n /**\n * Deserialize an any instance to a specific instance type.\n * @param {Constructor} targetType Type to deserialize to.\n * @param {*} instance Actual instance to deserialize.\n * @returns An instance of the target type.\n */\n static deserializeFromInstance<TResult extends object>(targetType: Constructor<TResult>, instance: any): TResult {\n const fields = Fields.getFieldsForType(targetType as Constructor);\n\n if (converterFor(targetType) || isConceptAs(targetType)) {\n return deserializeValueFromType(targetType, instance);\n }\n\n const deserialized = new targetType();\n for (const field of fields) {\n let value = instance[field.name];\n if (value !== undefined && value !== null) {\n if (field.type === Array) {\n const elementType = field.genericArguments[0];\n if (elementType) {\n const elementField = new Field(field.name, elementType, false, field.derivatives, []);\n value = value.map(_ => deserializeValueFromField(elementField, _));\n }\n } else if (field.enumerable) {\n value = value.map(_ => deserializeValueFromField(field, _));\n } else {\n value = deserializeValueFromField(field, value);\n }\n } else if ((field.enumerable || field.type === Array) && value === undefined) {\n // A collection that is absent from the payload deserializes to an empty one rather than to\n // undefined. The declared type says the field is an array, and a producer that leaves an\n // empty collection out - which the Chronicle sink does deliberately, so that a parallel\n // replay cannot overwrite children a sibling event already wrote - would otherwise hand back\n // a value contradicting its own type, putting a null guard on every reader of every\n // collection. An explicit null is left alone: that is the producer saying \"no collection\"\n // rather than \"an empty one\".\n value = [];\n }\n\n deserialized[field.name] = value;\n }\n\n // Preserve the polymorphic type discriminator so it is never lost across (de)serialization\n // layers. '_derivedTypeId' is not a declared field, so it is otherwise dropped here — and a\n // derived value whose concrete type could not be resolved (e.g. its type was not yet\n // registered) would then have no discriminator left to re-resolve or round-trip with, and\n // would serialize back with no type information at all.\n const derivedTypeId = instance[JsonSerializer.DerivedTypeIdProperty];\n if (derivedTypeId !== undefined && derivedTypeId !== null) {\n (deserialized as Record<string, unknown>)[JsonSerializer.DerivedTypeIdProperty] = derivedTypeId;\n }\n\n if ((targetType as Constructor) == Object) {\n const objectFields = Object.keys(instance).filter((value) => {\n return !fields.some(_ => _.name == value);\n });\n\n for (const field of objectFields) {\n deserialized[field] = instance[field];\n }\n }\n\n return deserialized;\n }\n\n /**\n * Deserialize an array of any instances to an array of specific instance types.\n * @param {Constructor} targetType Type to deserialize to.\n * @param {instances} instances Actual instances to deserialize.\n * @returns An array of instances of the target type.\n */\n static deserializeArrayFromInstance<TResult extends object>(targetType: Constructor<TResult>, instances: any): TResult[] {\n const deserialized: TResult[] = [];\n\n for (const instance of instances) {\n deserialized.push(this.deserializeFromInstance<TResult>(targetType, instance));\n }\n\n return deserialized;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAoCA,sBAAsB,EAAE;AAGxB,MAAM,UAAU,GAAoB;AAChC,IAAA,IAAI,iBAAiB,EAAE;AACvB,IAAA,IAAI,qBAAqB,EAAE;AAC3B,IAAA,IAAI,iBAAiB,EAAE;AACvB,IAAA,IAAI,qBAAqB,EAAE;AAC3B,IAAA,IAAI,qBAAqB,EAAE;AAC3B,IAAA,IAAI,kBAAkB,EAAE;AACxB,IAAA,IAAI,uBAAuB,EAAE;AAC7B,IAAA,I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,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC;AAC7C,YAAA,CAAC,CAAC;AAEF,YAAA,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE;gBAC9B,YAAY,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;YACzC;QACJ;AAEA,QAAA,OAAO,YAAY;IACvB;AAQA,IAAA,OAAO,4BAA4B,CAAyB,UAAgC,EAAE,SAAc,EAAA;QACxG,MAAM,YAAY,GAAc,EAAE;AAElC,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAC9B,YAAA,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAU,UAAU,EAAE,QAAQ,CAAC,CAAC;QAClF;AAEA,QAAA,OAAO,YAAY;IACvB;;;"}
|
package/dist/esm/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export { PropertyPathResolverProxyHandler } from './PropertyPathResolverProxyHan
|
|
|
22
22
|
export { TimeOnly } from './TimeOnly.js';
|
|
23
23
|
export { TimeSpan } from './TimeSpan.js';
|
|
24
24
|
export { ValueMap } from './ValueMap.js';
|
|
25
|
-
export { conceptAsTypeKey, declaredTypeKey, guidTypeKey, typeKey, typeKeyOf, valueMapTypeKey } from './typeKey.js';
|
|
25
|
+
export { conceptAsTypeKey, dateOnlyTypeKey, declaredTypeKey, guidTypeKey, timeOnlyTypeKey, timeSpanTypeKey, typeKey, typeKeyOf, valueMapTypeKey } from './typeKey.js';
|
|
26
26
|
export { field } from './fieldDecorator.js';
|
|
27
27
|
export { derivedType } from './derivedTypeDecorator.js';
|
|
28
28
|
export { JsonSerializer } from './JsonSerializer.js';
|
package/dist/esm/typeKey.d.ts
CHANGED
|
@@ -5,4 +5,7 @@ export declare const typeKeyOf: (type: Constructor | undefined) => string | unde
|
|
|
5
5
|
export declare const conceptAsTypeKey = "ConceptAs";
|
|
6
6
|
export declare const valueMapTypeKey = "ValueMap";
|
|
7
7
|
export declare const guidTypeKey = "Guid";
|
|
8
|
+
export declare const dateOnlyTypeKey = "DateOnly";
|
|
9
|
+
export declare const timeOnlyTypeKey = "TimeOnly";
|
|
10
|
+
export declare const timeSpanTypeKey = "TimeSpan";
|
|
8
11
|
//# sourceMappingURL=typeKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeKey.d.ts","sourceRoot":"","sources":["../../typeKey.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAiB5C,eAAO,MAAM,OAAO,EAAE,OAAO,MAAmD,CAAC;AAcjF,eAAO,MAAM,eAAe,GAAI,MAAM,WAAW,GAAG,SAAS,KAAG,MAAM,GAAG,SACiC,CAAC;AAW3G,eAAO,MAAM,SAAS,GAAI,MAAM,WAAW,GAAG,SAAS,KAAG,MAAM,GAAG,SAChB,CAAC;AAGpD,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAG5C,eAAO,MAAM,eAAe,aAAa,CAAC;AAG1C,eAAO,MAAM,WAAW,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"typeKey.d.ts","sourceRoot":"","sources":["../../typeKey.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAiB5C,eAAO,MAAM,OAAO,EAAE,OAAO,MAAmD,CAAC;AAcjF,eAAO,MAAM,eAAe,GAAI,MAAM,WAAW,GAAG,SAAS,KAAG,MAAM,GAAG,SACiC,CAAC;AAW3G,eAAO,MAAM,SAAS,GAAI,MAAM,WAAW,GAAG,SAAS,KAAG,MAAM,GAAG,SAChB,CAAC;AAGpD,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAG5C,eAAO,MAAM,eAAe,aAAa,CAAC;AAG1C,eAAO,MAAM,WAAW,SAAS,CAAC;AAGlC,eAAO,MAAM,eAAe,aAAa,CAAC;AAG1C,eAAO,MAAM,eAAe,aAAa,CAAC;AAG1C,eAAO,MAAM,eAAe,aAAa,CAAC"}
|
package/dist/esm/typeKey.js
CHANGED
|
@@ -4,6 +4,9 @@ const typeKeyOf = (type) => type ? type[typeKey] : undefined;
|
|
|
4
4
|
const conceptAsTypeKey = 'ConceptAs';
|
|
5
5
|
const valueMapTypeKey = 'ValueMap';
|
|
6
6
|
const guidTypeKey = 'Guid';
|
|
7
|
+
const dateOnlyTypeKey = 'DateOnly';
|
|
8
|
+
const timeOnlyTypeKey = 'TimeOnly';
|
|
9
|
+
const timeSpanTypeKey = 'TimeSpan';
|
|
7
10
|
|
|
8
|
-
export { conceptAsTypeKey, declaredTypeKey, guidTypeKey, typeKey, typeKeyOf, valueMapTypeKey };
|
|
11
|
+
export { conceptAsTypeKey, dateOnlyTypeKey, declaredTypeKey, guidTypeKey, timeOnlyTypeKey, timeSpanTypeKey, typeKey, typeKeyOf, valueMapTypeKey };
|
|
9
12
|
//# sourceMappingURL=typeKey.js.map
|
package/dist/esm/typeKey.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeKey.js","sources":["../../typeKey.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Constructor } from './Constructor';\n\n/**\n * Identifies a type this package converts, by name rather than by the class object itself.\n *\n * `JsonSerializer` recognized a type by comparing constructors, which holds until a second copy of this\n * package is loaded into the same realm - a nested install, or one install reached as both ESM and\n * CommonJS. Each copy then had its own `Guid`, `ConceptAs` and `ValueMap` class objects and neither\n * recognized the other's, so a `Guid` crossing that boundary was written as an object rather than a\n * string, and a concept as `{\"value\": ...}` rather than its underlying value. Both silently.\n *\n * A name survives the boundary where a class object does not: the key is a registered symbol, so every\n * copy resolves the same one, and the values are plain strings.\n *\n * The key is deliberately a symbol rather than a plain static: a string static would appear in\n * `Object.keys(Guid)` and could be shadowed by an unrelated member of the same name.\n */\nexport const typeKey: unique symbol = Symbol.for('@cratis/fundamentals.typeKey');\n\n/** A type carrying the key. Only this package's own convertible types declare one. */\ntype KeyedType = Constructor & { readonly [typeKey]?: string };\n\n/**\n * Gets the key a type declares itself, ignoring any inherited from a base type.\n *\n * Converter lookup uses this, because a key is inherited: a consumer's `class CustomerId extends\n * ConceptAs<string>` reports `ConceptAs`, and registering a converter under that would take the place\n * of concept handling for every concept in the application.\n * @param {Constructor} type The type to read the key from.\n * @returns {string | undefined} The declared key, or undefined when the type declares none.\n */\nexport const declaredTypeKey = (type: Constructor | undefined): string | undefined =>\n type && Object.prototype.hasOwnProperty.call(type, typeKey) ? (type as KeyedType)[typeKey] : undefined;\n\n/**\n * Gets the key a type carries, whether it declares the key or inherits it from a base type.\n *\n * This is what makes a concept recognizable across copies: the key is a static, and a static is\n * inherited through the constructor's prototype chain, so every type deriving from `ConceptAs` reports\n * `ConceptAs` without anything having to compare class objects.\n * @param {Constructor} type The type to read the key from.\n * @returns {string | undefined} The key carried, or undefined when the type carries none.\n */\nexport const typeKeyOf = (type: Constructor | undefined): string | undefined =>\n type ? (type as KeyedType)[typeKey] : undefined;\n\n/** The key every type deriving from `ConceptAs` carries. */\nexport const conceptAsTypeKey = 'ConceptAs';\n\n/** The key `ValueMap` declares. */\nexport const valueMapTypeKey = 'ValueMap';\n\n/** The key `Guid` declares. */\nexport const guidTypeKey = 'Guid';\n"],"names":[],"mappings":"AAoBO,MAAM,OAAO,GAAkB,MAAM,CAAC,GAAG,CAAC,8BAA8B;AAcxE,MAAM,eAAe,GAAG,CAAC,IAA6B,KACzD,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,GAAI,IAAkB,CAAC,OAAO,CAAC,GAAG;MAWpF,SAAS,GAAG,CAAC,IAA6B,KACnD,IAAI,GAAI,IAAkB,CAAC,OAAO,CAAC,GAAG;AAGnC,MAAM,gBAAgB,GAAG;AAGzB,MAAM,eAAe,GAAG;AAGxB,MAAM,WAAW,GAAG;;"}
|
|
1
|
+
{"version":3,"file":"typeKey.js","sources":["../../typeKey.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Constructor } from './Constructor';\n\n/**\n * Identifies a type this package converts, by name rather than by the class object itself.\n *\n * `JsonSerializer` recognized a type by comparing constructors, which holds until a second copy of this\n * package is loaded into the same realm - a nested install, or one install reached as both ESM and\n * CommonJS. Each copy then had its own `Guid`, `ConceptAs` and `ValueMap` class objects and neither\n * recognized the other's, so a `Guid` crossing that boundary was written as an object rather than a\n * string, and a concept as `{\"value\": ...}` rather than its underlying value. Both silently.\n *\n * A name survives the boundary where a class object does not: the key is a registered symbol, so every\n * copy resolves the same one, and the values are plain strings.\n *\n * The key is deliberately a symbol rather than a plain static: a string static would appear in\n * `Object.keys(Guid)` and could be shadowed by an unrelated member of the same name.\n */\nexport const typeKey: unique symbol = Symbol.for('@cratis/fundamentals.typeKey');\n\n/** A type carrying the key. Only this package's own convertible types declare one. */\ntype KeyedType = Constructor & { readonly [typeKey]?: string };\n\n/**\n * Gets the key a type declares itself, ignoring any inherited from a base type.\n *\n * Converter lookup uses this, because a key is inherited: a consumer's `class CustomerId extends\n * ConceptAs<string>` reports `ConceptAs`, and registering a converter under that would take the place\n * of concept handling for every concept in the application.\n * @param {Constructor} type The type to read the key from.\n * @returns {string | undefined} The declared key, or undefined when the type declares none.\n */\nexport const declaredTypeKey = (type: Constructor | undefined): string | undefined =>\n type && Object.prototype.hasOwnProperty.call(type, typeKey) ? (type as KeyedType)[typeKey] : undefined;\n\n/**\n * Gets the key a type carries, whether it declares the key or inherits it from a base type.\n *\n * This is what makes a concept recognizable across copies: the key is a static, and a static is\n * inherited through the constructor's prototype chain, so every type deriving from `ConceptAs` reports\n * `ConceptAs` without anything having to compare class objects.\n * @param {Constructor} type The type to read the key from.\n * @returns {string | undefined} The key carried, or undefined when the type carries none.\n */\nexport const typeKeyOf = (type: Constructor | undefined): string | undefined =>\n type ? (type as KeyedType)[typeKey] : undefined;\n\n/** The key every type deriving from `ConceptAs` carries. */\nexport const conceptAsTypeKey = 'ConceptAs';\n\n/** The key `ValueMap` declares. */\nexport const valueMapTypeKey = 'ValueMap';\n\n/** The key `Guid` declares. */\nexport const guidTypeKey = 'Guid';\n\n/** The key `DateOnly` declares. */\nexport const dateOnlyTypeKey = 'DateOnly';\n\n/** The key `TimeOnly` declares. */\nexport const timeOnlyTypeKey = 'TimeOnly';\n\n/** The key `TimeSpan` declares. */\nexport const timeSpanTypeKey = 'TimeSpan';\n"],"names":[],"mappings":"AAoBO,MAAM,OAAO,GAAkB,MAAM,CAAC,GAAG,CAAC,8BAA8B;AAcxE,MAAM,eAAe,GAAG,CAAC,IAA6B,KACzD,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,GAAI,IAAkB,CAAC,OAAO,CAAC,GAAG;MAWpF,SAAS,GAAG,CAAC,IAA6B,KACnD,IAAI,GAAI,IAAkB,CAAC,OAAO,CAAC,GAAG;AAGnC,MAAM,gBAAgB,GAAG;AAGzB,MAAM,eAAe,GAAG;AAGxB,MAAM,WAAW,GAAG;AAGpB,MAAM,eAAe,GAAG;AAGxB,MAAM,eAAe,GAAG;AAGxB,MAAM,eAAe,GAAG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"7.0.2","root":[[92,131]],"packageJsons":["../node_modules/tslib/modules/package.json","../node_modules/tslib/package.json","../package.json"],"fileNames":["lib.es5.d.ts","lib.es2015.d.ts","lib.es2016.d.ts","lib.es2017.d.ts","lib.es2018.d.ts","lib.es2019.d.ts","lib.es2020.d.ts","lib.es2021.d.ts","lib.es2022.d.ts","lib.es2023.d.ts","lib.es2024.d.ts","lib.es2025.d.ts","lib.esnext.d.ts","lib.dom.d.ts","lib.dom.iterable.d.ts","lib.es2015.core.d.ts","lib.es2015.collection.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.intl.d.ts","lib.es2017.arraybuffer.d.ts","lib.es2017.date.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.intl.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2019.intl.d.ts","lib.es2020.bigint.d.ts","lib.es2020.date.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.es2021.promise.d.ts","lib.es2021.string.d.ts","lib.es2021.weakref.d.ts","lib.es2021.intl.d.ts","lib.es2022.array.d.ts","lib.es2022.error.d.ts","lib.es2022.intl.d.ts","lib.es2022.object.d.ts","lib.es2022.string.d.ts","lib.es2022.regexp.d.ts","lib.es2023.array.d.ts","lib.es2023.collection.d.ts","lib.es2023.intl.d.ts","lib.es2024.arraybuffer.d.ts","lib.es2024.collection.d.ts","lib.es2024.object.d.ts","lib.es2024.promise.d.ts","lib.es2024.regexp.d.ts","lib.es2024.sharedmemory.d.ts","lib.es2024.string.d.ts","lib.es2025.collection.d.ts","lib.es2025.float16.d.ts","lib.es2025.intl.d.ts","lib.es2025.iterator.d.ts","lib.es2025.promise.d.ts","lib.es2025.regexp.d.ts","lib.esnext.array.d.ts","lib.esnext.collection.d.ts","lib.esnext.date.d.ts","lib.esnext.decorators.d.ts","lib.esnext.disposable.d.ts","lib.esnext.error.d.ts","lib.esnext.intl.d.ts","lib.esnext.sharedmemory.d.ts","lib.esnext.temporal.d.ts","lib.esnext.typedarrays.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","../node_modules/tslib/tslib.d.ts","../node_modules/tslib/modules/index.d.ts","../Constructor.ts","../typeKey.ts","../ConceptAs.ts","../Field.ts","../reflection.ts","../fieldDecoratorMetadata.ts","../Fields.ts","../StandardFieldDecoratorContext.ts","../fieldDecorator.ts","../DateOnly.ts","../DerivedType.ts","../IEquatable.ts","../Guid.ts","../duplicateInstanceGuard.ts","../ValueMap.ts","../json/JsonConverter.ts","../json/DateJsonConverter.ts","../json/DateOnlyJsonConverter.ts","../json/GuidJsonConverter.ts","../TimeOnly.ts","../json/TimeOnlyJsonConverter.ts","../TimeSpan.ts","../json/TimeSpanJsonConverter.ts","../geospatial/Point.ts","../geospatial/LinearRing.ts","../geospatial/LineString.ts","../geospatial/Polygon.ts","../geospatial/index.ts","../json/PointJsonConverter.ts","../json/LineStringJsonConverter.ts","../json/PolygonJsonConverter.ts","../json/ValueMapJsonConverter.ts","../json/index.ts","../JsonSerializer.ts","../PropertyAccessor.ts","../PropertyAccessorDescriptor.ts","../PropertyPathResolverProxyHandler.ts","../StandardClassDecoratorContext.ts","../derivedTypeDecorator.ts","../index.ts"],"fileInfos":[{"version":"16934abaab7026ac114da441aabea1a0","affectsGlobalScope":true,"impliedNodeFormat":1},"d4306fb2e47f74835e8674ffac07d76f","e437c5c1302869326c3bb93da85bbbcf","e4324975a566567b21d350615f1fc6ac","333b1b9a2a9ac3b8497dba5c63b5ba50","6cffacd662b6eb5fa7a36aa2ea366bfa","b4c34f9c23304dbef2d23698637ed638","e5cb86a5fc491796ecd1d2dd348d208f","feb6c6fb19cdb246a5d8acb36a6901c7","9443a7f109277ffaa79d893ed2549995","793cee405385076e27c24f409659dccd","09f69c6610266eaee1ac9e3e30df2c71","62bad718844246b8e17547f37bad6085",{"version":"aae8996e8b5684814785a42cbbefcd79","affectsGlobalScope":true,"impliedNodeFormat":1},"abad6dd56cc8caf095c165df8124d237",{"version":"926204c28cd3d073865348473ae28d2e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f25e42c801b2cb3cf2b39792006a9beb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6344b55f26a4e81d9608777dbfb877dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3c0ed28e53d3695b363e256ec1c023fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4c2761daba7f17141c25baa0821ac5da","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b87656acabd63e69379ff6ffcfe52fc7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"597469522da047a5af5222cc6989f405","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1708ea4d34dc37fadadc63ca01127e80","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"55d97a8c6fbf34a30450a7b1e5f7a298","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0ee05eb59426d33e374226d8dcfa708b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e347c14030993906efcfbb88915b6a05","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b0231263857c9b6a03641acdc9280ceb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3b15c4a83b598cacb4067676e6f0abed","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b417d97b7934cef63b1889abec0bbfbf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"09a6cf4032ebba60ce22a501e663f881","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2b056277dd138e8f5650fc04e20eaa8d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e22cc07e3f3cc242ba52fa3f8ea1fc58","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c45da767a1bfbb220848df1bc4029e4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b44c3e0fbaf2130cdcf6ac38b120ffa1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b612fb5cf8e5d964b92063a75207632a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02705151a5e1551b9162a9ed8ab763f7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"41025e398be9215d32e4337335da8f0b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"52684c2b1f353a5538e4f275182a54cd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6dedb6a4f90d1df3a6fbe5693e44886c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ca3f36fe3562c07e0f0d71c2bebd3f6d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"409974d6129befbb8226ddd1c6558568","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4d9cfde2a1ae1b4925f1f9bc10848e5d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7e1daecc66dd564144e3bb1a0266b5fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a8e1d9bb35fd0637f2f9fd2b2a54f2ec","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f168501772a6543182765bfd5f2fbfe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a19c80aad1b2162103496f5ba293a732","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b69afa63cd5d059851c78adb2856ee09","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ae2fc5d954e9b0f5feee3d481b953c27","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1cfd3091a071d8b6feec15277643bafe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1da2c1f258970fd3cc91184f69e91a9d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a0d87491913d843139e0c993650a3235","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4ef72aa378127e7b7abba915b0110b1e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3ec74c6a7d4463f0254db3a74cf75646","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84c2bdfa470d075526cce6322d81b0b6","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0b3844c2b8c73e4e1ab91431411cad11","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4fc71cf4a15b8d99675a31df77f26e07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d1b49564ddaeca3df5b6dbae925d2242","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6a25be566d60ccfc2d6e8b7bfdeefa83","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8a20e27646985dfd58c57ca6566553dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9969f02ad3cdcbf4f709405cda44167f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c9be4792a7a4f42c15ae7360bf28779","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8cf777fe00349b71ee9c4b6f3fe7fd19","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"74f96bc192530c9723f572bfff3d3078","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1df91c56b25955c56387426f378173c5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"38856f70edcd2115c355d96ec77cc09e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"de8700156c1275465bcd473c28b359aa","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d47cfdb6ede40518357bb5a4cd7cd9fb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6e5773860cd9e5b15e683113f642ab47","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"30ff5fe1682f7fcd629880476ca3c2e0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf23d7d1b40b9015b694ddc2f011752f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2cc585d42e2c548f9f24a30a1989fd33","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"713906ce9d332d2242b7f05ed9304be3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0219894bfe5042c7e1aa2d22e4a91ed0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6009ffff7e43c93318804d2d28e37fe3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"03be89b227587594fbb50509fc1c2e45","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b30df52dc24740c0bad7c55c3511df7d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ab8d3c9b5ed5c2ab8f383607eef439f0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d950ec671d0a8e07f3c1a31e94abed86","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1abef2ace5eccb02d60dd73cd5a5ee4c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5f0a3044029d1cc081b5887eb4deb07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d57c697f1446940ec4bfe669c962e2c4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"be41035d7b941482a1e1ae6a5c5dcca5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"10f7d9da7564f27f8ddf4a162b6da6d3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1d0520af549e0c3581f15173cc713ca1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d65083f97fd741cff028472563eddb79","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"da7f24f00653ebac660ac1c0821ed33d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7cb5ae9e65516ea2235f0721f6aac43c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f64453cbf9671f28158677fa5c43967a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"33f317af5428801f944a478d2c1e38e5","affectsGlobalScope":true,"impliedNodeFormat":1},"68565f078f6cbaa18bac7ac1aee706a4",{"version":"6df9988546b1b8e15cb137c4ed46c629","impliedNodeFormat":99},{"version":"04bfab517bef8ec649195900a112645a","signature":"0aa13ceea7e7c3f53c785d7ca09fc461","impliedNodeFormat":1},{"version":"d55806511032bffc887528ffc98bee9f","signature":"c2f6baeb9792f6582a4c97ed3f1041cf","impliedNodeFormat":1},{"version":"a7ffa0f207e5e558300b989f56e10ed8","signature":"dee26c2062ab4d0c96825cd9f06fc8ec","impliedNodeFormat":1},{"version":"30572a6c021fe02cf36ded539f81c4ab","signature":"86f3667a6b4bdf2ea2cb1b3d22824431","impliedNodeFormat":1},{"version":"d6444c005923a0e29b164735b3faf628","signature":"3ebc9c537c34634924dad5f75a5e826d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"eed8a4269d54d1b794fc93932726b39a","signature":"4c5307b1c87b22bd7862ce9245df2355","impliedNodeFormat":1},{"version":"4dad3ba63dfa4906aa5d59f3b088a12a","signature":"0c843f46bbfeb9f4f5e2f551ac701e71","impliedNodeFormat":1},{"version":"2a26f729ac58a50a4af8ae4cb949113b","signature":"56e1e5e440c94e1e1d7f6e87e79ad79a","impliedNodeFormat":1},{"version":"1a5c6baa45b220f4318f3265c59548eb","signature":"613a934507b0cfd0950cb8e6973dfedf","impliedNodeFormat":1},{"version":"485c2c85724ef7b3927b680aea8a91f9","signature":"bad057a4b4ea4af9b6014d316293750a","impliedNodeFormat":1},{"version":"b361021d3d18d13aac63b35d4b0ef1d1","signature":"e574772f7137c7acb41b9b4cf9df058d","impliedNodeFormat":1},{"version":"10bacfe190f9fe270633c42af70386a1","signature":"38aed49039f4cd461d25f012f97b8c39","impliedNodeFormat":1},{"version":"cc34701bb2e1462b45d017a6fe2f141f","signature":"719dfec5f3283ec85710adbba78e6365","impliedNodeFormat":1},{"version":"4824fb9728966ca9f9ce17b9ce75f05c","signature":"c2020050bac2e38d3fa0a6b493982137","impliedNodeFormat":1},{"version":"a1749f74fd525e58a163f183940e7e09","signature":"6aa3c11249f9aaa1ac65d937ead30969","impliedNodeFormat":1},{"version":"351814ccfa1ba58ef45ec89a4aeb404c","signature":"f98eec2170a99869483d3eca900d0cc0","impliedNodeFormat":1},{"version":"5184ac9b0d8991786893fe84aa78d6b9","signature":"b5ebd566a1965c6a14cd722344ce6f6e","impliedNodeFormat":1},{"version":"c7735481ae825eb6bbcfd4a9805ba6c1","signature":"a7d694b86b36ce7df89de40ffc9402aa","impliedNodeFormat":1},{"version":"908d0f661e9c957f8aa06d19d4ab330d","signature":"6417e5a1c83740dd726339c7dcb25e00","impliedNodeFormat":1},{"version":"7ac4e2073efabc8a9b3ffd50e858f616","signature":"a45a1270e3bec3c20dfc71dbd1f4c873","impliedNodeFormat":1},{"version":"9e48231dbfedcc7214ebef6ea6286a23","signature":"6fbd3fb27221371a80b8e5096ab64669","impliedNodeFormat":1},{"version":"dbf142eb5e53d886df2e7093c459d38a","signature":"819455b7d09613669008590152f72bfb","impliedNodeFormat":1},{"version":"458e81f3aa2be4dce8b9c74ea9501bbb","signature":"cb18508ff8bbf75a7e3ab6a4326d04bc","impliedNodeFormat":1},{"version":"27ff541c8e95725471b6b63deda1cee5","signature":"58b7f36019024977c58e8f9578061940","impliedNodeFormat":1},{"version":"5a1c99c1b8aee61fe81f2c24580f964a","signature":"f54113fe7e33138fa6bef35633d9c756","impliedNodeFormat":1},{"version":"640a86079ef069627d498d92042be3fd","signature":"9ebee2bd622814352f911c1123c777bb","impliedNodeFormat":1},{"version":"c61a48c85d6c125ca9883e4b050cdca7","signature":"1c1616eb4a9ee2509a326a00d2bb66f7","impliedNodeFormat":1},{"version":"422db4edf8c3ce6cf7e553ebd6fb9d67","signature":"9cb1145b2a3893442ee4af6d07a433a1","impliedNodeFormat":1},{"version":"f5389e83dd9ce8454cf4c529c3f27303","signature":"f39ebf82376bef22974827fb45fc2868","impliedNodeFormat":1},{"version":"aa02a24e6da8595f2ddf20291c42af9f","signature":"1fb32a9a54778e35701953fde7d6a644","impliedNodeFormat":1},{"version":"5565dbac2a69a59c1fcba503a6e50586","signature":"5faf589f6dca05637ace1b1e2b65a5d9","impliedNodeFormat":1},{"version":"8e1e86bc20e3c61f979e2567130c7842","signature":"b862c86ba994a1012909a9193bf8fccb","impliedNodeFormat":1},{"version":"11d4a6190e2dfd54e76be78ac56a83d2","signature":"c008349de6f254aab2ea421ab4467148","impliedNodeFormat":1},{"version":"153eb030a0af1896fa9f01694f42f98c","signature":"619e7562793b95efc8e4045b345c2958","impliedNodeFormat":1},{"version":"90afd3587a9a35670427e6961c843453","signature":"5c86fabce3450c64974c38377a4c7e78","impliedNodeFormat":1},{"version":"88e8ac668c482d4adea78be66563f1df","signature":"44105eab8a75458fcab12433d5d313c3","impliedNodeFormat":1},{"version":"975510ec28b104338b0200ad7da6681a","signature":"94ffea549c13e56a8cf4c04a811cbc75","impliedNodeFormat":1},{"version":"4233f8df71c1590dc418143794641f46","signature":"5c8de80b459b0cbf43397cfb4b8ff0d3","impliedNodeFormat":1},{"version":"77ef4441645eb9547648b763c0e124d6","signature":"d42cb94635f66e63be4724c41308e9c7","impliedNodeFormat":1},{"version":"22ac9c87f6f69a0d5e058def48f6029e","signature":"58604a62d80d6df338da00a0caafddb6","impliedNodeFormat":1}],"fileIdsList":[[93],[93,100],[92,96],[92],[92,95,96,97],[93,103],[92,93,95,98,102,104,105,106,124],[126],[92,96,102,129],[92,95,97,98,99],[92,95,96],[93,115],[115],[93,116],[115,116,117,118],[92,93,94,95,98,100,101,102,103,104,106,111,113,119,124,125,126,127,128,130],[92,107],[92,101,107],[92,104,107],[92,107,119],[92,107,111],[92,107,113],[92,106,107],[107,108,109,110,112,114,120,121,122,123],[90]],"options":{"allowJs":false,"assumeChangesOnlyAffectDirectDependencies":true,"checkJs":false,"composite":true,"emitDecoratorMetadata":true,"declaration":true,"declarationMap":true,"experimentalDecorators":true,"importHelpers":true,"jsx":4,"module":7,"newLine":2,"noFallthroughCasesInSwitch":true,"noImplicitAny":false,"noImplicitReturns":true,"outDir":"./","preserveConstEnums":true,"removeComments":true,"rootDir":"..","skipLibCheck":true,"strict":true,"strictNullChecks":true,"stripInternal":true,"sourceMap":true,"target":9,"allowSyntheticDefaultImports":true,"alwaysStrict":true,"esModuleInterop":true},"referencedMap":[[94,1],[101,2],[102,3],[95,4],[98,5],[104,6],[125,7],[127,8],[129,4],[111,2],[113,2],[106,1],[130,9],[100,10],[97,11],[117,12],[116,13],[115,2],[118,14],[119,15],[131,16],[108,17],[109,18],[110,19],[107,4],[121,20],[120,20],[122,20],[112,21],[114,22],[123,23],[124,24],[91,25],[93,4]],"latestChangedDtsFile":"./index.d.ts"}
|
|
1
|
+
{"version":"7.0.2","root":[[92,131]],"packageJsons":["../node_modules/tslib/modules/package.json","../node_modules/tslib/package.json","../package.json"],"fileNames":["lib.es5.d.ts","lib.es2015.d.ts","lib.es2016.d.ts","lib.es2017.d.ts","lib.es2018.d.ts","lib.es2019.d.ts","lib.es2020.d.ts","lib.es2021.d.ts","lib.es2022.d.ts","lib.es2023.d.ts","lib.es2024.d.ts","lib.es2025.d.ts","lib.esnext.d.ts","lib.dom.d.ts","lib.dom.iterable.d.ts","lib.es2015.core.d.ts","lib.es2015.collection.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.intl.d.ts","lib.es2017.arraybuffer.d.ts","lib.es2017.date.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.intl.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2019.intl.d.ts","lib.es2020.bigint.d.ts","lib.es2020.date.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.es2021.promise.d.ts","lib.es2021.string.d.ts","lib.es2021.weakref.d.ts","lib.es2021.intl.d.ts","lib.es2022.array.d.ts","lib.es2022.error.d.ts","lib.es2022.intl.d.ts","lib.es2022.object.d.ts","lib.es2022.string.d.ts","lib.es2022.regexp.d.ts","lib.es2023.array.d.ts","lib.es2023.collection.d.ts","lib.es2023.intl.d.ts","lib.es2024.arraybuffer.d.ts","lib.es2024.collection.d.ts","lib.es2024.object.d.ts","lib.es2024.promise.d.ts","lib.es2024.regexp.d.ts","lib.es2024.sharedmemory.d.ts","lib.es2024.string.d.ts","lib.es2025.collection.d.ts","lib.es2025.float16.d.ts","lib.es2025.intl.d.ts","lib.es2025.iterator.d.ts","lib.es2025.promise.d.ts","lib.es2025.regexp.d.ts","lib.esnext.array.d.ts","lib.esnext.collection.d.ts","lib.esnext.date.d.ts","lib.esnext.decorators.d.ts","lib.esnext.disposable.d.ts","lib.esnext.error.d.ts","lib.esnext.intl.d.ts","lib.esnext.sharedmemory.d.ts","lib.esnext.temporal.d.ts","lib.esnext.typedarrays.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","../node_modules/tslib/tslib.d.ts","../node_modules/tslib/modules/index.d.ts","../Constructor.ts","../typeKey.ts","../ConceptAs.ts","../Field.ts","../reflection.ts","../fieldDecoratorMetadata.ts","../Fields.ts","../StandardFieldDecoratorContext.ts","../fieldDecorator.ts","../DateOnly.ts","../DerivedType.ts","../IEquatable.ts","../Guid.ts","../duplicateInstanceGuard.ts","../TimeOnly.ts","../TimeSpan.ts","../ValueMap.ts","../json/JsonConverter.ts","../json/DateJsonConverter.ts","../json/DateOnlyJsonConverter.ts","../json/GuidJsonConverter.ts","../json/TimeOnlyJsonConverter.ts","../json/TimeSpanJsonConverter.ts","../geospatial/Point.ts","../geospatial/LinearRing.ts","../geospatial/LineString.ts","../geospatial/Polygon.ts","../geospatial/index.ts","../json/PointJsonConverter.ts","../json/LineStringJsonConverter.ts","../json/PolygonJsonConverter.ts","../json/ValueMapJsonConverter.ts","../json/index.ts","../JsonSerializer.ts","../PropertyAccessor.ts","../PropertyAccessorDescriptor.ts","../PropertyPathResolverProxyHandler.ts","../StandardClassDecoratorContext.ts","../derivedTypeDecorator.ts","../index.ts"],"fileInfos":[{"version":"16934abaab7026ac114da441aabea1a0","affectsGlobalScope":true,"impliedNodeFormat":1},"d4306fb2e47f74835e8674ffac07d76f","e437c5c1302869326c3bb93da85bbbcf","e4324975a566567b21d350615f1fc6ac","333b1b9a2a9ac3b8497dba5c63b5ba50","6cffacd662b6eb5fa7a36aa2ea366bfa","b4c34f9c23304dbef2d23698637ed638","e5cb86a5fc491796ecd1d2dd348d208f","feb6c6fb19cdb246a5d8acb36a6901c7","9443a7f109277ffaa79d893ed2549995","793cee405385076e27c24f409659dccd","09f69c6610266eaee1ac9e3e30df2c71","62bad718844246b8e17547f37bad6085",{"version":"aae8996e8b5684814785a42cbbefcd79","affectsGlobalScope":true,"impliedNodeFormat":1},"abad6dd56cc8caf095c165df8124d237",{"version":"926204c28cd3d073865348473ae28d2e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f25e42c801b2cb3cf2b39792006a9beb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6344b55f26a4e81d9608777dbfb877dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3c0ed28e53d3695b363e256ec1c023fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4c2761daba7f17141c25baa0821ac5da","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b87656acabd63e69379ff6ffcfe52fc7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"597469522da047a5af5222cc6989f405","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1708ea4d34dc37fadadc63ca01127e80","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"55d97a8c6fbf34a30450a7b1e5f7a298","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0ee05eb59426d33e374226d8dcfa708b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e347c14030993906efcfbb88915b6a05","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b0231263857c9b6a03641acdc9280ceb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3b15c4a83b598cacb4067676e6f0abed","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b417d97b7934cef63b1889abec0bbfbf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"09a6cf4032ebba60ce22a501e663f881","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2b056277dd138e8f5650fc04e20eaa8d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e22cc07e3f3cc242ba52fa3f8ea1fc58","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c45da767a1bfbb220848df1bc4029e4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b44c3e0fbaf2130cdcf6ac38b120ffa1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b612fb5cf8e5d964b92063a75207632a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02705151a5e1551b9162a9ed8ab763f7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"41025e398be9215d32e4337335da8f0b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"52684c2b1f353a5538e4f275182a54cd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6dedb6a4f90d1df3a6fbe5693e44886c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ca3f36fe3562c07e0f0d71c2bebd3f6d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"409974d6129befbb8226ddd1c6558568","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4d9cfde2a1ae1b4925f1f9bc10848e5d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7e1daecc66dd564144e3bb1a0266b5fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a8e1d9bb35fd0637f2f9fd2b2a54f2ec","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f168501772a6543182765bfd5f2fbfe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a19c80aad1b2162103496f5ba293a732","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b69afa63cd5d059851c78adb2856ee09","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ae2fc5d954e9b0f5feee3d481b953c27","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1cfd3091a071d8b6feec15277643bafe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1da2c1f258970fd3cc91184f69e91a9d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a0d87491913d843139e0c993650a3235","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4ef72aa378127e7b7abba915b0110b1e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3ec74c6a7d4463f0254db3a74cf75646","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84c2bdfa470d075526cce6322d81b0b6","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0b3844c2b8c73e4e1ab91431411cad11","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4fc71cf4a15b8d99675a31df77f26e07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d1b49564ddaeca3df5b6dbae925d2242","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6a25be566d60ccfc2d6e8b7bfdeefa83","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8a20e27646985dfd58c57ca6566553dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9969f02ad3cdcbf4f709405cda44167f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c9be4792a7a4f42c15ae7360bf28779","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8cf777fe00349b71ee9c4b6f3fe7fd19","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"74f96bc192530c9723f572bfff3d3078","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1df91c56b25955c56387426f378173c5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"38856f70edcd2115c355d96ec77cc09e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"de8700156c1275465bcd473c28b359aa","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d47cfdb6ede40518357bb5a4cd7cd9fb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6e5773860cd9e5b15e683113f642ab47","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"30ff5fe1682f7fcd629880476ca3c2e0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf23d7d1b40b9015b694ddc2f011752f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2cc585d42e2c548f9f24a30a1989fd33","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"713906ce9d332d2242b7f05ed9304be3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0219894bfe5042c7e1aa2d22e4a91ed0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6009ffff7e43c93318804d2d28e37fe3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"03be89b227587594fbb50509fc1c2e45","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b30df52dc24740c0bad7c55c3511df7d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ab8d3c9b5ed5c2ab8f383607eef439f0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d950ec671d0a8e07f3c1a31e94abed86","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1abef2ace5eccb02d60dd73cd5a5ee4c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5f0a3044029d1cc081b5887eb4deb07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d57c697f1446940ec4bfe669c962e2c4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"be41035d7b941482a1e1ae6a5c5dcca5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"10f7d9da7564f27f8ddf4a162b6da6d3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1d0520af549e0c3581f15173cc713ca1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d65083f97fd741cff028472563eddb79","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"da7f24f00653ebac660ac1c0821ed33d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7cb5ae9e65516ea2235f0721f6aac43c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f64453cbf9671f28158677fa5c43967a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"33f317af5428801f944a478d2c1e38e5","affectsGlobalScope":true,"impliedNodeFormat":1},"68565f078f6cbaa18bac7ac1aee706a4",{"version":"6df9988546b1b8e15cb137c4ed46c629","impliedNodeFormat":99},{"version":"04bfab517bef8ec649195900a112645a","signature":"0aa13ceea7e7c3f53c785d7ca09fc461","impliedNodeFormat":1},{"version":"e285e85b907a1ede9eb00700121ab05f","signature":"25b556595c58144e9f689861cf51007e","impliedNodeFormat":1},{"version":"a7ffa0f207e5e558300b989f56e10ed8","signature":"dee26c2062ab4d0c96825cd9f06fc8ec","impliedNodeFormat":1},{"version":"30572a6c021fe02cf36ded539f81c4ab","signature":"86f3667a6b4bdf2ea2cb1b3d22824431","impliedNodeFormat":1},{"version":"d6444c005923a0e29b164735b3faf628","signature":"3ebc9c537c34634924dad5f75a5e826d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"eed8a4269d54d1b794fc93932726b39a","signature":"4c5307b1c87b22bd7862ce9245df2355","impliedNodeFormat":1},{"version":"4dad3ba63dfa4906aa5d59f3b088a12a","signature":"0c843f46bbfeb9f4f5e2f551ac701e71","impliedNodeFormat":1},{"version":"2a26f729ac58a50a4af8ae4cb949113b","signature":"56e1e5e440c94e1e1d7f6e87e79ad79a","impliedNodeFormat":1},{"version":"1a5c6baa45b220f4318f3265c59548eb","signature":"613a934507b0cfd0950cb8e6973dfedf","impliedNodeFormat":1},{"version":"485c2c85724ef7b3927b680aea8a91f9","signature":"bad057a4b4ea4af9b6014d316293750a","impliedNodeFormat":1},{"version":"b361021d3d18d13aac63b35d4b0ef1d1","signature":"e574772f7137c7acb41b9b4cf9df058d","impliedNodeFormat":1},{"version":"10bacfe190f9fe270633c42af70386a1","signature":"38aed49039f4cd461d25f012f97b8c39","impliedNodeFormat":1},{"version":"cc34701bb2e1462b45d017a6fe2f141f","signature":"719dfec5f3283ec85710adbba78e6365","impliedNodeFormat":1},{"version":"4824fb9728966ca9f9ce17b9ce75f05c","signature":"c2020050bac2e38d3fa0a6b493982137","impliedNodeFormat":1},{"version":"7ac4e2073efabc8a9b3ffd50e858f616","signature":"a45a1270e3bec3c20dfc71dbd1f4c873","impliedNodeFormat":1},{"version":"dbf142eb5e53d886df2e7093c459d38a","signature":"819455b7d09613669008590152f72bfb","impliedNodeFormat":1},{"version":"a1749f74fd525e58a163f183940e7e09","signature":"6aa3c11249f9aaa1ac65d937ead30969","impliedNodeFormat":1},{"version":"351814ccfa1ba58ef45ec89a4aeb404c","signature":"f98eec2170a99869483d3eca900d0cc0","impliedNodeFormat":1},{"version":"5184ac9b0d8991786893fe84aa78d6b9","signature":"b5ebd566a1965c6a14cd722344ce6f6e","impliedNodeFormat":1},{"version":"c7735481ae825eb6bbcfd4a9805ba6c1","signature":"a7d694b86b36ce7df89de40ffc9402aa","impliedNodeFormat":1},{"version":"908d0f661e9c957f8aa06d19d4ab330d","signature":"6417e5a1c83740dd726339c7dcb25e00","impliedNodeFormat":1},{"version":"9e48231dbfedcc7214ebef6ea6286a23","signature":"6fbd3fb27221371a80b8e5096ab64669","impliedNodeFormat":1},{"version":"458e81f3aa2be4dce8b9c74ea9501bbb","signature":"cb18508ff8bbf75a7e3ab6a4326d04bc","impliedNodeFormat":1},{"version":"27ff541c8e95725471b6b63deda1cee5","signature":"58b7f36019024977c58e8f9578061940","impliedNodeFormat":1},{"version":"5a1c99c1b8aee61fe81f2c24580f964a","signature":"f54113fe7e33138fa6bef35633d9c756","impliedNodeFormat":1},{"version":"640a86079ef069627d498d92042be3fd","signature":"9ebee2bd622814352f911c1123c777bb","impliedNodeFormat":1},{"version":"c61a48c85d6c125ca9883e4b050cdca7","signature":"1c1616eb4a9ee2509a326a00d2bb66f7","impliedNodeFormat":1},{"version":"422db4edf8c3ce6cf7e553ebd6fb9d67","signature":"9cb1145b2a3893442ee4af6d07a433a1","impliedNodeFormat":1},{"version":"f5389e83dd9ce8454cf4c529c3f27303","signature":"f39ebf82376bef22974827fb45fc2868","impliedNodeFormat":1},{"version":"aa02a24e6da8595f2ddf20291c42af9f","signature":"1fb32a9a54778e35701953fde7d6a644","impliedNodeFormat":1},{"version":"5565dbac2a69a59c1fcba503a6e50586","signature":"5faf589f6dca05637ace1b1e2b65a5d9","impliedNodeFormat":1},{"version":"8e1e86bc20e3c61f979e2567130c7842","signature":"b862c86ba994a1012909a9193bf8fccb","impliedNodeFormat":1},{"version":"11d4a6190e2dfd54e76be78ac56a83d2","signature":"c008349de6f254aab2ea421ab4467148","impliedNodeFormat":1},{"version":"edda0494f23091aa7c2faab44e0b62e3","signature":"619e7562793b95efc8e4045b345c2958","impliedNodeFormat":1},{"version":"90afd3587a9a35670427e6961c843453","signature":"5c86fabce3450c64974c38377a4c7e78","impliedNodeFormat":1},{"version":"88e8ac668c482d4adea78be66563f1df","signature":"44105eab8a75458fcab12433d5d313c3","impliedNodeFormat":1},{"version":"975510ec28b104338b0200ad7da6681a","signature":"94ffea549c13e56a8cf4c04a811cbc75","impliedNodeFormat":1},{"version":"4233f8df71c1590dc418143794641f46","signature":"5c8de80b459b0cbf43397cfb4b8ff0d3","impliedNodeFormat":1},{"version":"77ef4441645eb9547648b763c0e124d6","signature":"d42cb94635f66e63be4724c41308e9c7","impliedNodeFormat":1},{"version":"22ac9c87f6f69a0d5e058def48f6029e","signature":"58604a62d80d6df338da00a0caafddb6","impliedNodeFormat":1}],"fileIdsList":[[93],[93,100],[92,96],[92],[92,95,96,97],[93,103],[92,93,95,98,101,102,104,105,106,107,108,124],[126],[92,96,102,129],[92,95,97,98,99],[92,95,96],[93,115],[115],[93,116],[115,116,117,118],[92,93,94,95,98,100,101,102,103,104,106,107,108,119,124,125,126,127,128,130],[92,109],[92,101,109],[92,104,109],[92,109,119],[92,106,109],[92,107,109],[92,108,109],[109,110,111,112,113,114,120,121,122,123],[90]],"options":{"allowJs":false,"assumeChangesOnlyAffectDirectDependencies":true,"checkJs":false,"composite":true,"emitDecoratorMetadata":true,"declaration":true,"declarationMap":true,"experimentalDecorators":true,"importHelpers":true,"jsx":4,"module":7,"newLine":2,"noFallthroughCasesInSwitch":true,"noImplicitAny":false,"noImplicitReturns":true,"outDir":"./","preserveConstEnums":true,"removeComments":true,"rootDir":"..","skipLibCheck":true,"strict":true,"strictNullChecks":true,"stripInternal":true,"sourceMap":true,"target":9,"allowSyntheticDefaultImports":true,"alwaysStrict":true,"esModuleInterop":true},"referencedMap":[[94,1],[101,2],[102,3],[95,4],[98,5],[104,6],[125,7],[127,8],[129,4],[106,2],[107,2],[108,1],[130,9],[100,10],[97,11],[117,12],[116,13],[115,2],[118,14],[119,15],[131,16],[110,17],[111,18],[112,19],[109,4],[121,20],[120,20],[122,20],[113,21],[114,22],[123,23],[124,24],[91,25],[93,4]],"latestChangedDtsFile":"./index.d.ts"}
|
package/dist/typeKey.d.ts
CHANGED
|
@@ -5,4 +5,7 @@ export declare const typeKeyOf: (type: Constructor | undefined) => string | unde
|
|
|
5
5
|
export declare const conceptAsTypeKey = "ConceptAs";
|
|
6
6
|
export declare const valueMapTypeKey = "ValueMap";
|
|
7
7
|
export declare const guidTypeKey = "Guid";
|
|
8
|
+
export declare const dateOnlyTypeKey = "DateOnly";
|
|
9
|
+
export declare const timeOnlyTypeKey = "TimeOnly";
|
|
10
|
+
export declare const timeSpanTypeKey = "TimeSpan";
|
|
8
11
|
//# sourceMappingURL=typeKey.d.ts.map
|
package/dist/typeKey.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeKey.d.ts","sourceRoot":"","sources":["../typeKey.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAiB5C,eAAO,MAAM,OAAO,EAAE,OAAO,MAAmD,CAAC;AAcjF,eAAO,MAAM,eAAe,SAAU,WAAW,GAAG,SAAS,KAAG,MAAM,GAAG,SACiC,CAAC;AAW3G,eAAO,MAAM,SAAS,SAAU,WAAW,GAAG,SAAS,KAAG,MAAM,GAAG,SAChB,CAAC;AAGpD,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAG5C,eAAO,MAAM,eAAe,aAAa,CAAC;AAG1C,eAAO,MAAM,WAAW,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"typeKey.d.ts","sourceRoot":"","sources":["../typeKey.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAiB5C,eAAO,MAAM,OAAO,EAAE,OAAO,MAAmD,CAAC;AAcjF,eAAO,MAAM,eAAe,SAAU,WAAW,GAAG,SAAS,KAAG,MAAM,GAAG,SACiC,CAAC;AAW3G,eAAO,MAAM,SAAS,SAAU,WAAW,GAAG,SAAS,KAAG,MAAM,GAAG,SAChB,CAAC;AAGpD,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAG5C,eAAO,MAAM,eAAe,aAAa,CAAC;AAG1C,eAAO,MAAM,WAAW,SAAS,CAAC;AAGlC,eAAO,MAAM,eAAe,aAAa,CAAC;AAG1C,eAAO,MAAM,eAAe,aAAa,CAAC;AAG1C,eAAO,MAAM,eAAe,aAAa,CAAC"}
|
package/dist/typeKey.js
CHANGED
|
@@ -4,4 +4,7 @@ export const typeKeyOf = (type) => type ? type[typeKey] : undefined;
|
|
|
4
4
|
export const conceptAsTypeKey = 'ConceptAs';
|
|
5
5
|
export const valueMapTypeKey = 'ValueMap';
|
|
6
6
|
export const guidTypeKey = 'Guid';
|
|
7
|
+
export const dateOnlyTypeKey = 'DateOnly';
|
|
8
|
+
export const timeOnlyTypeKey = 'TimeOnly';
|
|
9
|
+
export const timeSpanTypeKey = 'TimeSpan';
|
|
7
10
|
//# sourceMappingURL=typeKey.js.map
|
package/dist/typeKey.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-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AM,gBAAgB,GAAG,WAAW,CAAC;AAG5C,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAG1C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC;AAGlC,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAG1C,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAG1C,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { TimeSpan } from '../TimeSpan';
|
|
5
|
+
import { JsonSerializer } from '../JsonSerializer';
|
|
6
|
+
import { ValueMap } from '../ValueMap';
|
|
7
|
+
import { field } from '../fieldDecorator';
|
|
8
|
+
|
|
9
|
+
class Totals {
|
|
10
|
+
@field(ValueMap, { genericArguments: [TimeSpan, Number] })
|
|
11
|
+
byKey!: ValueMap<TimeSpan, number>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('when deserializing a value map with negative TimeSpan keys as C# writes them', () => {
|
|
15
|
+
const result = JsonSerializer.deserialize(Totals, JSON.stringify({ byKey: { '-1.02:03:04.5000000': 7 } }));
|
|
16
|
+
|
|
17
|
+
it('should read the key as the same negative time span', () => [...result.byKey.entries()][0][0].toString().should.equal(TimeSpan.parse('-1.02:03:04.5').toString()));
|
|
18
|
+
it('should find the value by the equivalent key', () => result.byKey.get(TimeSpan.parse('-1.02:03:04.5'))!.should.equal(7));
|
|
19
|
+
});
|
package/for_JsonSerializer/when_deserializing_a_value_map_with_c_sharp_written_time_only_keys.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { TimeOnly } from '../TimeOnly';
|
|
5
|
+
import { JsonSerializer } from '../JsonSerializer';
|
|
6
|
+
import { ValueMap } from '../ValueMap';
|
|
7
|
+
import { field } from '../fieldDecorator';
|
|
8
|
+
|
|
9
|
+
class Totals {
|
|
10
|
+
@field(ValueMap, { genericArguments: [TimeOnly, Number] })
|
|
11
|
+
byKey!: ValueMap<TimeOnly, number>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('when deserializing a value map with TimeOnly keys as C# writes them', () => {
|
|
15
|
+
const result = JsonSerializer.deserialize(Totals, JSON.stringify({ byKey: { '10:11:12.1230000': 7 } }));
|
|
16
|
+
|
|
17
|
+
it('should read the key as the same time', () => [...result.byKey.entries()][0][0].toString().should.equal(TimeOnly.parse('10:11:12.123').toString()));
|
|
18
|
+
it('should find the value by the equivalent key', () => result.byKey.get(TimeOnly.parse('10:11:12.123'))!.should.equal(7));
|
|
19
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { TimeSpan } from '../TimeSpan';
|
|
5
|
+
import { JsonSerializer } from '../JsonSerializer';
|
|
6
|
+
import { ValueMap } from '../ValueMap';
|
|
7
|
+
import { field } from '../fieldDecorator';
|
|
8
|
+
|
|
9
|
+
class Totals {
|
|
10
|
+
@field(ValueMap, { genericArguments: [TimeSpan, Number] })
|
|
11
|
+
byKey!: ValueMap<TimeSpan, number>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('when deserializing a value map with whole second TimeSpan keys as C# writes them', () => {
|
|
15
|
+
const result = JsonSerializer.deserialize(Totals, JSON.stringify({ byKey: { '1.02:03:04': 7 } }));
|
|
16
|
+
|
|
17
|
+
it('should read the key as the same time span', () => [...result.byKey.entries()][0][0].toString().should.equal(TimeSpan.parse('1.02:03:04').toString()));
|
|
18
|
+
it('should find the value by the equivalent key', () => result.byKey.get(TimeSpan.parse('1.02:03:04'))!.should.equal(7));
|
|
19
|
+
});
|
package/for_JsonSerializer/when_deserializing_a_value_map_with_legacy_quoted_date_only_keys.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { DateOnly } from '../DateOnly';
|
|
5
|
+
import { JsonSerializer } from '../JsonSerializer';
|
|
6
|
+
import { ValueMap } from '../ValueMap';
|
|
7
|
+
import { field } from '../fieldDecorator';
|
|
8
|
+
|
|
9
|
+
class Totals {
|
|
10
|
+
@field(ValueMap, { genericArguments: [DateOnly, Number] })
|
|
11
|
+
byKey!: ValueMap<DateOnly, number>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('when deserializing a value map with legacy quoted DateOnly keys', () => {
|
|
15
|
+
const result = JsonSerializer.deserialize(Totals, JSON.stringify({ byKey: { '"2024-03-05"': 7 } }));
|
|
16
|
+
|
|
17
|
+
it('should read the key as the original value', () => [...result.byKey.entries()][0][0].toString().should.equal('2024-03-05'));
|
|
18
|
+
it('should find the value by the original key', () => result.byKey.get(DateOnly.parse('2024-03-05'))!.should.equal(7));
|
|
19
|
+
});
|
package/for_JsonSerializer/when_deserializing_a_value_map_with_legacy_quoted_time_only_keys.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { TimeOnly } from '../TimeOnly';
|
|
5
|
+
import { JsonSerializer } from '../JsonSerializer';
|
|
6
|
+
import { ValueMap } from '../ValueMap';
|
|
7
|
+
import { field } from '../fieldDecorator';
|
|
8
|
+
|
|
9
|
+
class Totals {
|
|
10
|
+
@field(ValueMap, { genericArguments: [TimeOnly, Number] })
|
|
11
|
+
byKey!: ValueMap<TimeOnly, number>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('when deserializing a value map with legacy quoted TimeOnly keys', () => {
|
|
15
|
+
const result = JsonSerializer.deserialize(Totals, JSON.stringify({ byKey: { '"10:11:12.123"': 7 } }));
|
|
16
|
+
|
|
17
|
+
it('should read the key as the original value', () => [...result.byKey.entries()][0][0].toString().should.equal('10:11:12.123'));
|
|
18
|
+
it('should find the value by the original key', () => result.byKey.get(TimeOnly.parse('10:11:12.123'))!.should.equal(7));
|
|
19
|
+
});
|
package/for_JsonSerializer/when_deserializing_a_value_map_with_legacy_quoted_time_span_keys.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { TimeSpan } from '../TimeSpan';
|
|
5
|
+
import { JsonSerializer } from '../JsonSerializer';
|
|
6
|
+
import { ValueMap } from '../ValueMap';
|
|
7
|
+
import { field } from '../fieldDecorator';
|
|
8
|
+
|
|
9
|
+
class Totals {
|
|
10
|
+
@field(ValueMap, { genericArguments: [TimeSpan, Number] })
|
|
11
|
+
byKey!: ValueMap<TimeSpan, number>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('when deserializing a value map with legacy quoted TimeSpan keys', () => {
|
|
15
|
+
const result = JsonSerializer.deserialize(Totals, JSON.stringify({ byKey: { '"1.02:03:04.5"': 7 } }));
|
|
16
|
+
|
|
17
|
+
it('should read the key as the original value', () => [...result.byKey.entries()][0][0].toString().should.equal('1.02:03:04.5'));
|
|
18
|
+
it('should find the value by the original key', () => result.byKey.get(TimeSpan.parse('1.02:03:04.5'))!.should.equal(7));
|
|
19
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { DateOnly } from '../DateOnly';
|
|
5
|
+
import { JsonSerializer } from '../JsonSerializer';
|
|
6
|
+
import { ValueMap } from '../ValueMap';
|
|
7
|
+
import { field } from '../fieldDecorator';
|
|
8
|
+
|
|
9
|
+
class Totals {
|
|
10
|
+
@field(ValueMap, { genericArguments: [DateOnly, Number] })
|
|
11
|
+
byKey!: ValueMap<DateOnly, number>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('when deserializing a value map with malformed DateOnly keys', () => {
|
|
15
|
+
const plain = () => JsonSerializer.deserialize(Totals, '{"byKey":{"not-valid":1}}');
|
|
16
|
+
const quoted = () => JsonSerializer.deserialize(Totals, JSON.stringify({ byKey: { '"not-valid"': 1 } }));
|
|
17
|
+
|
|
18
|
+
it('should reject a malformed plain key', () => plain.should.throw('not a valid DateOnly'));
|
|
19
|
+
it('should reject a malformed quoted key', () => quoted.should.throw('not a valid DateOnly'));
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { TimeOnly } from '../TimeOnly';
|
|
5
|
+
import { JsonSerializer } from '../JsonSerializer';
|
|
6
|
+
import { ValueMap } from '../ValueMap';
|
|
7
|
+
import { field } from '../fieldDecorator';
|
|
8
|
+
|
|
9
|
+
class Totals {
|
|
10
|
+
@field(ValueMap, { genericArguments: [TimeOnly, Number] })
|
|
11
|
+
byKey!: ValueMap<TimeOnly, number>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('when deserializing a value map with malformed TimeOnly keys', () => {
|
|
15
|
+
const plain = () => JsonSerializer.deserialize(Totals, '{"byKey":{"not-valid":1}}');
|
|
16
|
+
const quoted = () => JsonSerializer.deserialize(Totals, JSON.stringify({ byKey: { '"not-valid"': 1 } }));
|
|
17
|
+
|
|
18
|
+
it('should reject a malformed plain key', () => plain.should.throw('not a valid TimeOnly'));
|
|
19
|
+
it('should reject a malformed quoted key', () => quoted.should.throw('not a valid TimeOnly'));
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { TimeSpan } from '../TimeSpan';
|
|
5
|
+
import { JsonSerializer } from '../JsonSerializer';
|
|
6
|
+
import { ValueMap } from '../ValueMap';
|
|
7
|
+
import { field } from '../fieldDecorator';
|
|
8
|
+
|
|
9
|
+
class Totals {
|
|
10
|
+
@field(ValueMap, { genericArguments: [TimeSpan, Number] })
|
|
11
|
+
byKey!: ValueMap<TimeSpan, number>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('when deserializing a value map with malformed TimeSpan keys', () => {
|
|
15
|
+
const plain = () => JsonSerializer.deserialize(Totals, '{"byKey":{"not-valid":1}}');
|
|
16
|
+
const quoted = () => JsonSerializer.deserialize(Totals, JSON.stringify({ byKey: { '"not-valid"': 1 } }));
|
|
17
|
+
|
|
18
|
+
it('should reject a malformed plain key', () => plain.should.throw('not a valid TimeSpan'));
|
|
19
|
+
it('should reject a malformed quoted key', () => quoted.should.throw('not a valid TimeSpan'));
|
|
20
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { DateOnly } from '../DateOnly';
|
|
5
|
+
import { JsonSerializer } from '../JsonSerializer';
|
|
6
|
+
import { ValueMap } from '../ValueMap';
|
|
7
|
+
import { field } from '../fieldDecorator';
|
|
8
|
+
|
|
9
|
+
class Totals {
|
|
10
|
+
@field(ValueMap, { genericArguments: [DateOnly, Number] })
|
|
11
|
+
byKey!: ValueMap<DateOnly, number>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('when round tripping a value map with DateOnly keys', () => {
|
|
15
|
+
const key = DateOnly.parse('2024-03-05');
|
|
16
|
+
const totals = new Totals();
|
|
17
|
+
totals.byKey = new ValueMap<DateOnly, number>().set(key, 42);
|
|
18
|
+
|
|
19
|
+
const written = JsonSerializer.serialize(totals);
|
|
20
|
+
const read = JsonSerializer.deserialize(Totals, written);
|
|
21
|
+
|
|
22
|
+
it('should write the key as the plain string', () => written.should.equal('{"byKey":{"2024-03-05":42}}'));
|
|
23
|
+
it('should read the key back as a DateOnly', () => [...read.byKey.entries()][0][0].should.be.instanceof(DateOnly));
|
|
24
|
+
it('should read the key back as the original value', () => [...read.byKey.entries()][0][0].toString().should.equal('2024-03-05'));
|
|
25
|
+
it('should find the value by the original key', () => read.byKey.get(key)!.should.equal(42));
|
|
26
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { TimeOnly } from '../TimeOnly';
|
|
5
|
+
import { JsonSerializer } from '../JsonSerializer';
|
|
6
|
+
import { ValueMap } from '../ValueMap';
|
|
7
|
+
import { field } from '../fieldDecorator';
|
|
8
|
+
|
|
9
|
+
class Totals {
|
|
10
|
+
@field(ValueMap, { genericArguments: [TimeOnly, Number] })
|
|
11
|
+
byKey!: ValueMap<TimeOnly, number>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('when round tripping a value map with TimeOnly keys', () => {
|
|
15
|
+
const key = TimeOnly.parse('10:11:12.123');
|
|
16
|
+
const totals = new Totals();
|
|
17
|
+
totals.byKey = new ValueMap<TimeOnly, number>().set(key, 42);
|
|
18
|
+
|
|
19
|
+
const written = JsonSerializer.serialize(totals);
|
|
20
|
+
const read = JsonSerializer.deserialize(Totals, written);
|
|
21
|
+
|
|
22
|
+
it('should write the key as the plain string', () => written.should.equal('{"byKey":{"10:11:12.123":42}}'));
|
|
23
|
+
it('should read the key back as a TimeOnly', () => [...read.byKey.entries()][0][0].should.be.instanceof(TimeOnly));
|
|
24
|
+
it('should read the key back as the original value', () => [...read.byKey.entries()][0][0].toString().should.equal('10:11:12.123'));
|
|
25
|
+
it('should find the value by the original key', () => read.byKey.get(key)!.should.equal(42));
|
|
26
|
+
});
|