@cratis/fundamentals 7.19.3 → 7.19.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/DateOnly.ts +3 -3
  2. package/Guid.ts +1 -1
  3. package/IEquatable.ts +1 -1
  4. package/JsonSerializer.ts +13 -6
  5. package/StandardClassDecoratorContext.ts +1 -0
  6. package/StandardFieldDecoratorContext.ts +1 -0
  7. package/dist/JsonSerializer.d.ts.map +1 -1
  8. package/dist/JsonSerializer.js +15 -6
  9. package/dist/JsonSerializer.js.map +1 -1
  10. package/dist/StandardClassDecoratorContext.d.ts.map +1 -1
  11. package/dist/StandardFieldDecoratorContext.d.ts.map +1 -1
  12. package/dist/cjs/DateOnly.js.map +1 -1
  13. package/dist/cjs/Guid.js.map +1 -1
  14. package/dist/cjs/JsonSerializer.d.ts.map +1 -1
  15. package/dist/cjs/JsonSerializer.js +15 -6
  16. package/dist/cjs/JsonSerializer.js.map +1 -1
  17. package/dist/cjs/StandardClassDecoratorContext.d.ts.map +1 -1
  18. package/dist/cjs/StandardFieldDecoratorContext.d.ts.map +1 -1
  19. package/dist/cjs/fieldDecorator.d.ts.map +1 -1
  20. package/dist/cjs/fieldDecorator.js.map +1 -1
  21. package/dist/esm/DateOnly.js.map +1 -1
  22. package/dist/esm/Guid.js.map +1 -1
  23. package/dist/esm/JsonSerializer.d.ts.map +1 -1
  24. package/dist/esm/JsonSerializer.js +15 -6
  25. package/dist/esm/JsonSerializer.js.map +1 -1
  26. package/dist/esm/StandardClassDecoratorContext.d.ts.map +1 -1
  27. package/dist/esm/StandardFieldDecoratorContext.d.ts.map +1 -1
  28. package/dist/esm/fieldDecorator.d.ts.map +1 -1
  29. package/dist/esm/fieldDecorator.js.map +1 -1
  30. package/dist/fieldDecorator.d.ts.map +1 -1
  31. package/dist/fieldDecorator.js.map +1 -1
  32. package/dist/tsconfig.tsbuildinfo +1 -1
  33. package/fieldDecorator.ts +4 -0
  34. package/for_JsonSerializer/Types.ts +0 -1
  35. package/for_JsonSerializer/given/a_model_with_field_metadata.ts +63 -0
  36. package/for_JsonSerializer/given/given.ts +6 -0
  37. package/for_JsonSerializer/when_deserializing_fields_with_legacy_decorators.ts +41 -0
  38. package/for_JsonSerializer/when_deserializing_generic_array_without_a_value.ts +10 -0
  39. package/for_JsonSerializer/when_round_tripping_fields_with_legacy_decorators.ts +31 -0
  40. package/for_fieldDecorator/fixtures/standard_decorated_types.ts +53 -2
  41. package/for_fieldDecorator/when_executing_standard_typescript_decorator_emit.ts +46 -1
  42. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"DateOnly.js","sources":["../../DateOnly.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 { field } from './fieldDecorator';\nimport { typeKey } from './typeKey';\n\nconst dateOnlyRegex = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\n/**\n * Represents a date with no time and no time zone - a day on a calendar.\n * @remarks\n * Deliberately not a JavaScript `Date`. A `Date` is an instant, and a calendar date is not one: turning\n * `2026-05-12` into a `Date` produces UTC midnight, which every browser-local getter west of UTC reads back as\n * the 11th. That is a wrong answer that looks right, and it is only wrong for users in some time zones - which is\n * how it survives development in others.\n *\n * Holding the three parts the server sent means there is no instant to convert and nothing to shift. Where a\n * `Date` is genuinely wanted - to feed a date picker, or to do arithmetic - {@link toDate} constructs one in the\n * local time zone, and the choice is then visible at the call site making it.\n */\nexport class DateOnly {\n static readonly [typeKey] = 'DateOnly';\n\n /**\n * The year.\n */\n @field(Number)\n year!: number;\n\n /**\n * The month, 1 through 12.\n */\n @field(Number)\n month!: number;\n\n /**\n * The day of the month, 1 through 31.\n */\n @field(Number)\n day!: number;\n\n /**\n * Creates a {@link DateOnly} from its parts.\n * @param year The year.\n * @param month The month, 1 through 12.\n * @param day The day of the month.\n * @returns The {@link DateOnly}.\n */\n static from(year: number, month: number, day: number): DateOnly {\n const dateOnly = new DateOnly();\n dateOnly.year = year;\n dateOnly.month = month;\n dateOnly.day = day;\n return dateOnly;\n }\n\n /**\n * Parses the ISO-8601 calendar date the server sends, `yyyy-MM-dd`.\n * @param value The value to parse.\n * @returns The {@link DateOnly}.\n */\n static parse(value: string): DateOnly {\n const match = dateOnlyRegex.exec(value);\n if (match === null) {\n throw new Error(`Invalid DateOnly format: ${value}`);\n }\n\n return DateOnly.from(parseInt(match[1], 10), parseInt(match[2], 10), parseInt(match[3], 10));\n }\n\n /**\n * Creates a {@link DateOnly} for the calendar date a {@link Date} falls on in the local time zone.\n * @param date The date to take the calendar date of.\n * @returns The {@link DateOnly}.\n * @remarks\n * Reads the local parts rather than the UTC ones, because the calendar date a moment falls on is a question\n * only a time zone can answer, and the local one is the one the person looking at the screen is in.\n */\n static fromDate(date: Date): DateOnly {\n return DateOnly.from(date.getFullYear(), date.getMonth() + 1, date.getDate());\n }\n\n /**\n * Converts to a {@link Date} at midnight in the local time zone.\n * @returns The {@link Date}.\n * @remarks\n * Local rather than UTC, so the date a caller reads back with `getDate()` is the one they started with. This\n * invents a time that was never sent, which is why it is a method to call rather than what the value is.\n */\n toDate(): Date {\n return new Date(this.year, this.month - 1, this.day);\n }\n\n /**\n * Gets the ISO-8601 representation, `yyyy-MM-dd` - the same form the server sent.\n * @returns The string.\n */\n toString(): string {\n const month = this.month.toString().padStart(2, '0');\n const day = this.day.toString().padStart(2, '0');\n return `${this.year.toString().padStart(4, '0')}-${month}-${day}`;\n }\n\n /**\n * Gets the ISO-8601 representation used when this is serialized as JSON.\n *\n * Without this, `JSON.stringify` falls back to enumerating `year`, `month` and `day`, so a\n * request body carries a component object where the server expects the scalar string.\n * @returns The string.\n */\n toJSON(): string {\n return this.toString();\n }\n\n /**\n * Determines whether this is the same calendar date as another.\n * @param other The other date.\n * @returns True when they are the same date.\n */\n equals(other: DateOnly | undefined | null): boolean {\n return !!other && this.year === other.year && this.month === other.month && this.day === other.day;\n }\n}\n"],"names":[],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QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AACpD,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAChD,QAAA,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA,CAAA,EAAI,KAAK,CAAA,CAAA,EAAI,GAAG,EAAE;IACrE;IASA,MAAM,GAAA;AACF,QAAA,OAAO,IAAI,CAAC,QAAQ,EAAE;IAC1B;AAOA,IAAA,MAAM,CAAC,KAAkC,EAAA;QACrC,OAAO,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG;IACtG;;AA9FA,UAAA,CAAA;IADC,KAAK,CAAC,MAAM,CAAC;;AACA,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAMd,UAAA,CAAA;IADC,KAAK,CAAC,MAAM,CAAC;;AACC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAMf,UAAA,CAAA;IADC,KAAK,CAAC,MAAM,CAAC;;AACD,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,KAAA,EAAA,MAAA,CAAA;;"}
1
+ {"version":3,"file":"DateOnly.js","sources":["../../DateOnly.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 { field } from './fieldDecorator';\nimport { typeKey } from './typeKey';\n\nconst dateOnlyRegex = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\n/**\n * Represents a date with no time and no time zone - a day on a calendar.\n * @remarks\n * Deliberately not a JavaScript `Date`. A `Date` is an instant, and a calendar date is not one: turning\n * `2026-05-12` into a `Date` produces UTC midnight, which every browser-local getter west of UTC reads back as\n * the 11th. That is a wrong answer that looks right, and it is only wrong for users in some time zones - which is\n * how it survives development in others.\n *\n * Holding the three parts the server sent means there is no instant to convert and nothing to shift. Where a\n * `Date` is genuinely wanted - to feed a date picker, or to do arithmetic - {@link toDate} constructs one in the\n * local time zone, and the choice is then visible at the call site making it.\n */\nexport class DateOnly {\n static readonly [typeKey] = 'DateOnly';\n\n /**\n * The year.\n */\n @field(Number)\n year!: number;\n\n /**\n * The month, 1 through 12.\n */\n @field(Number)\n month!: number;\n\n /**\n * The day of the month, 1 through 31.\n */\n @field(Number)\n day!: number;\n\n /**\n * Creates a {@link DateOnly} from its parts.\n * @param year The year.\n * @param month The month, 1 through 12.\n * @param day The day of the month.\n * @returns The {@link DateOnly}.\n */\n static from(year: number, month: number, day: number): DateOnly {\n const dateOnly = new DateOnly();\n dateOnly.year = year;\n dateOnly.month = month;\n dateOnly.day = day;\n return dateOnly;\n }\n\n /**\n * Parses the ISO-8601 calendar date the server sends, `yyyy-MM-dd`.\n * @param value The value to parse.\n * @returns The {@link DateOnly}.\n */\n static parse(value: string): DateOnly {\n const match = dateOnlyRegex.exec(value);\n if (match === null) {\n throw new Error(`Invalid DateOnly format: ${value}`);\n }\n\n return DateOnly.from(parseInt(match[1], 10), parseInt(match[2], 10), parseInt(match[3], 10));\n }\n\n /**\n * Creates a {@link DateOnly} for the calendar date a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date | Date} falls on in the local time zone.\n * @param date The date to take the calendar date of.\n * @returns The {@link DateOnly}.\n * @remarks\n * Reads the local parts rather than the UTC ones, because the calendar date a moment falls on is a question\n * only a time zone can answer, and the local one is the one the person looking at the screen is in.\n */\n static fromDate(date: Date): DateOnly {\n return DateOnly.from(date.getFullYear(), date.getMonth() + 1, date.getDate());\n }\n\n /**\n * Converts to a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date | Date} at midnight in the local time zone.\n * @returns The {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date | Date}.\n * @remarks\n * Local rather than UTC, so the date a caller reads back with `getDate()` is the one they started with. This\n * invents a time that was never sent, which is why it is a method to call rather than what the value is.\n */\n toDate(): Date {\n return new Date(this.year, this.month - 1, this.day);\n }\n\n /**\n * Gets the ISO-8601 representation, `yyyy-MM-dd` - the same form the server sent.\n * @returns The string.\n */\n toString(): string {\n const month = this.month.toString().padStart(2, '0');\n const day = this.day.toString().padStart(2, '0');\n return `${this.year.toString().padStart(4, '0')}-${month}-${day}`;\n }\n\n /**\n * Gets the ISO-8601 representation used when this is serialized as JSON.\n *\n * Without this, `JSON.stringify` falls back to enumerating `year`, `month` and `day`, so a\n * request body carries a component object where the server expects the scalar string.\n * @returns The string.\n */\n toJSON(): string {\n return this.toString();\n }\n\n /**\n * Determines whether this is the same calendar date as another.\n * @param other The other date.\n * @returns True when they are the same date.\n */\n equals(other: DateOnly | undefined | null): boolean {\n return !!other && this.year === other.year && this.month === other.month && this.day === other.day;\n }\n}\n"],"names":[],"mappings":";;;;AAMA,MAAM,aAAa,GAAG,2BAA2B;MAcpC,QAAQ,CAAA;AACjB,IAAA,QAAiB,OAAO,IAAI,UAAU;AAMtC,IAAA,IAAI;AAMJ,IAAA,KAAK;AAML,IAAA,GAAG;AASH,IAAA,OAAO,IAAI,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW,EAAA;AAChD,QAAA,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE;AAC/B,QAAA,QAAQ,CAAC,IAAI,GAAG,IAAI;AACpB,QAAA,QAAQ,CAAC,KAAK,GAAG,KAAK;AACtB,QAAA,QAAQ,CAAC,GAAG,GAAG,GAAG;AAClB,QAAA,OAAO,QAAQ;IACnB;IAOA,OAAO,KAAK,CA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AA,MAAM,CAAC,KAAkC,EAAA;QACrC,OAAO,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG;IACtG;;AA9FA,UAAA,CAAA;IADC,KAAK,CAAC,MAAM,CAAC;;AACA,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAMd,UAAA,CAAA;IADC,KAAK,CAAC,MAAM,CAAC;;AACC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAMf,UAAA,CAAA;IADC,KAAK,CAAC,MAAM,CAAC;;AACD,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,KAAA,EAAA,MAAA,CAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Guid.js","sources":["../../Guid.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 { IEquatable } from './IEquatable';\nimport { typeKey } from './typeKey';\n\nconst guidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;\nconst lookUpTable: string[] = [];\n(() => {\n for (let i = 0; i < 256; i += 1) {\n lookUpTable[i] = (i < 16 ? '0' : '') + (i).toString(16);\n }\n})();\n\nconst getString = (num: number) => {\n return num.toString(16).padStart(2, '0');\n};\n\n/**\n * Represents a Guid according to the http://www.ietf.org/rfc/rfc4122.txt\n *\n * @export\n * @class Guid\n */\nexport class Guid implements IEquatable {\n static readonly [typeKey] = 'Guid';\n\n\n /**\n * Gets an empty {Guid}\n */\n static readonly empty = new Guid([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);\n\n private _stringVersion = '';\n\n\n /**\n * Initializes a new instance of the {Guid} class.\n * @param {number[]|Uint8Array} bytes - The 16 bytes that represents a {Guid}.\n */\n constructor(readonly bytes: number[] | Uint8Array | undefined) {\n if( bytes === undefined ) {\n this._stringVersion = Guid.empty.toString();\n return;\n }\n\n this._stringVersion = '' +\n getString(bytes[3]) + getString(bytes[2]) + getString(bytes[1]) + getString(bytes[0]) +\n '-' +\n getString(bytes[5]) + getString(bytes[4]) +\n '-' +\n getString(bytes[7]) + getString(bytes[6]) +\n '-' +\n getString(bytes[8]) + getString(bytes[9]) +\n '-' +\n getString(bytes[10]) + getString(bytes[11]) + getString(bytes[12]) + getString(bytes[13]) + getString(bytes[14]) + getString(bytes[15]);\n }\n\n /**\n * Create a new {Guid}\n * @returns {Guid}\n */\n static create(): Guid {\n const d0 = Math.random() * 0xFFFFFFFF | 0;\n const d1 = Math.random() * 0xFFFFFFFF | 0;\n const d2 = Math.random() * 0xFFFFFFFF | 0;\n const d3 = Math.random() * 0xFFFFFFFF | 0;\n\n const bytes = [\n lookUpTable[d0 & 0xFF],\n lookUpTable[d0 >> 8 & 0xFF],\n lookUpTable[d0 >> 16 & 0xFF],\n lookUpTable[d0 >> 24 & 0xFF],\n lookUpTable[d1 & 0xFF],\n lookUpTable[d1 >> 8 & 0xFF],\n lookUpTable[d1 >> 16 & 0x0F | 0x40],\n lookUpTable[d1 >> 24 & 0xFF],\n lookUpTable[d2 & 0x3F | 0x80],\n lookUpTable[d2 >> 8 & 0xFF],\n lookUpTable[d2 >> 16 & 0xFF],\n lookUpTable[d2 >> 24 & 0xFF],\n lookUpTable[d3 & 0xFF],\n lookUpTable[d3 >> 8 & 0xFF],\n lookUpTable[d3 >> 16 & 0xFF],\n lookUpTable[d3 >> 24 & 0xFF]\n ];\n\n return new Guid(bytes.map(_ => parseInt(`0x${_}`, 16)));\n }\n\n /**\n * Parses a string and turns it into a {Guid}.\n * @param {string} guid String representation of guid.\n */\n static parse(guid: string): Guid {\n const bytes: number[] = [];\n guid.split('-').map((number, index) => {\n const bytesInChar = index < 3 ? number.match(/.{1,2}/g)?.reverse() : number.match(/.{1,2}/g);\n bytesInChar?.map((byte) => { bytes.push(parseInt(byte, 16)); });\n });\n\n return new Guid(bytes);\n }\n\n /**\n * Check if a string is a valid {Guid}\n * @param {string} value Value to check.\n * @returns True if it is, false if not.\n */\n static isGuid(value: string): boolean {\n return guidRegex.test(value);\n }\n\n /**\n * Parses if the type is a string parse, otherwise pass through the input as desired output type.\n * @template T Type to handle for\n * @param {string|T} input String or the generic type.\n * @returns identifier Parsed or passed through\n */\n static as<T extends Guid = Guid>(input: string | T): T {\n if (typeof input === 'string') {\n return Guid.parse(input) as T;\n }\n return input as T;\n }\n\n /**\n * @inheritdoc\n */\n equals(other: object): boolean {\n const actualOther = other instanceof Guid ? other : other.toString();\n if (typeof actualOther === 'string' && !Guid.isGuid(actualOther)) {\n return false;\n }\n\n return Guid.as(actualOther).toString() === this.toString();\n }\n\n /**\n * Return a string representation of the {Guid} in the format: 00000000-0000-0000-0000-000000000000\n * @returns {string}\n */\n toString(): string {\n return this._stringVersion;\n }\n\n /**\n * Converts the {Guid} to a string that works in JSON serialization.\n * @returns {string}\n */\n toJSON(): string {\n return this._stringVersion;\n }\n}\n"],"names":[],"mappings":";;AAMA,MAAM,SAAS,GAAG,+EAA+E;AACjG,MAAM,WAAW,GAAa,EAAE;AAChC,CAAC,MAAK;AACF,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QAC7B,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC;IAC3D;AACJ,CAAC,GAAG;AAEJ,MAAM,SAAS,GAAG,CAAC,GAAW,KAAI;AAC9B,IAAA,OAAO,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CA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A,OAAO,KAAU;IACrB;AAKA,IAAA,MAAM,CAAC,KAAa,EAAA;AAChB,QAAA,MAAM,WAAW,GAAG,KAAK,YAAY,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE;AACpE,QAAA,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;AAC9D,YAAA,OAAO,KAAK;QAChB;AAEA,QAAA,OAAO,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,QAAQ,EAAE;IAC9D;IAMA,QAAQ,GAAA;QACJ,OAAO,IAAI,CAAC,cAAc;IAC9B;IAMA,MAAM,GAAA;QACF,OAAO,IAAI,CAAC,cAAc;IAC9B;;;"}
1
+ {"version":3,"file":"Guid.js","sources":["../../Guid.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 { IEquatable } from './IEquatable';\nimport { typeKey } from './typeKey';\n\nconst guidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;\nconst lookUpTable: string[] = [];\n(() => {\n for (let i = 0; i < 256; i += 1) {\n lookUpTable[i] = (i < 16 ? '0' : '') + (i).toString(16);\n }\n})();\n\nconst getString = (num: number) => {\n return num.toString(16).padStart(2, '0');\n};\n\n/**\n * Represents a Guid according to the http://www.ietf.org/rfc/rfc4122.txt\n *\n * @public\n * @class Guid\n */\nexport class Guid implements IEquatable {\n static readonly [typeKey] = 'Guid';\n\n\n /**\n * Gets an empty {Guid}\n */\n static readonly empty = new Guid([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);\n\n private _stringVersion = '';\n\n\n /**\n * Initializes a new instance of the {Guid} class.\n * @param {number[]|Uint8Array} bytes - The 16 bytes that represents a {Guid}.\n */\n constructor(readonly bytes: number[] | Uint8Array | undefined) {\n if( bytes === undefined ) {\n this._stringVersion = Guid.empty.toString();\n return;\n }\n\n this._stringVersion = '' +\n getString(bytes[3]) + getString(bytes[2]) + getString(bytes[1]) + getString(bytes[0]) +\n '-' +\n getString(bytes[5]) + getString(bytes[4]) +\n '-' +\n getString(bytes[7]) + getString(bytes[6]) +\n '-' +\n getString(bytes[8]) + getString(bytes[9]) +\n '-' +\n getString(bytes[10]) + getString(bytes[11]) + getString(bytes[12]) + getString(bytes[13]) + getString(bytes[14]) + getString(bytes[15]);\n }\n\n /**\n * Create a new {Guid}\n * @returns {Guid}\n */\n static create(): Guid {\n const d0 = Math.random() * 0xFFFFFFFF | 0;\n const d1 = Math.random() * 0xFFFFFFFF | 0;\n const d2 = Math.random() * 0xFFFFFFFF | 0;\n const d3 = Math.random() * 0xFFFFFFFF | 0;\n\n const bytes = [\n lookUpTable[d0 & 0xFF],\n lookUpTable[d0 >> 8 & 0xFF],\n lookUpTable[d0 >> 16 & 0xFF],\n lookUpTable[d0 >> 24 & 0xFF],\n lookUpTable[d1 & 0xFF],\n lookUpTable[d1 >> 8 & 0xFF],\n lookUpTable[d1 >> 16 & 0x0F | 0x40],\n lookUpTable[d1 >> 24 & 0xFF],\n lookUpTable[d2 & 0x3F | 0x80],\n lookUpTable[d2 >> 8 & 0xFF],\n lookUpTable[d2 >> 16 & 0xFF],\n lookUpTable[d2 >> 24 & 0xFF],\n lookUpTable[d3 & 0xFF],\n lookUpTable[d3 >> 8 & 0xFF],\n lookUpTable[d3 >> 16 & 0xFF],\n lookUpTable[d3 >> 24 & 0xFF]\n ];\n\n return new Guid(bytes.map(_ => parseInt(`0x${_}`, 16)));\n }\n\n /**\n * Parses a string and turns it into a {Guid}.\n * @param {string} guid String representation of guid.\n */\n static parse(guid: string): Guid {\n const bytes: number[] = [];\n guid.split('-').map((number, index) => {\n const bytesInChar = index < 3 ? number.match(/.{1,2}/g)?.reverse() : number.match(/.{1,2}/g);\n bytesInChar?.map((byte) => { bytes.push(parseInt(byte, 16)); });\n });\n\n return new Guid(bytes);\n }\n\n /**\n * Check if a string is a valid {Guid}\n * @param {string} value Value to check.\n * @returns True if it is, false if not.\n */\n static isGuid(value: string): boolean {\n return guidRegex.test(value);\n }\n\n /**\n * Parses if the type is a string parse, otherwise pass through the input as desired output type.\n * @template T Type to handle for\n * @param {string|T} input String or the generic type.\n * @returns identifier Parsed or passed through\n */\n static as<T extends Guid = Guid>(input: string | T): T {\n if (typeof input === 'string') {\n return Guid.parse(input) as T;\n }\n return input as T;\n }\n\n /**\n * @inheritdoc\n */\n equals(other: object): boolean {\n const actualOther = other instanceof Guid ? other : other.toString();\n if (typeof actualOther === 'string' && !Guid.isGuid(actualOther)) {\n return false;\n }\n\n return Guid.as(actualOther).toString() === this.toString();\n }\n\n /**\n * Return a string representation of the {Guid} in the format: 00000000-0000-0000-0000-000000000000\n * @returns {string}\n */\n toString(): string {\n return this._stringVersion;\n }\n\n /**\n * Converts the {Guid} to a string that works in JSON serialization.\n * @returns {string}\n */\n toJSON(): string {\n return this._stringVersion;\n }\n}\n"],"names":[],"mappings":";;AAMA,MAAM,SAAS,GAAG,+EAA+E;AACjG,MAAM,WAAW,GAAa,EAAE;AAChC,CAAC,MAAK;AACF,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QAC7B,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC;IAC3D;AACJ,CAAC,GAAG;AAEJ,MAAM,SAAS,GAAG,CAAC,GAAW,KAAI;AAC9B,IAAA,OAAO,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAC5C,CAAC;MAQY,IAAI,CAAA;AAgBQ,IA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A2DhH,MAAM,CAAC,4BAA4B,CAAC,OAAO,SAAS,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,OAAO,EAAE;CAS3H"}
1
+ {"version":3,"file":"JsonSerializer.d.ts","sourceRoot":"","sources":["../../JsonSerializer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C,OAAO,EACH,aAAa,EAUhB,MAAM,QAAQ,CAAC;AAuShB,qBAAa,cAAc;IACvB,MAAM,CAAC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAoB;IAmBjE,MAAM,CAAC,iBAAiB,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI;IASxD,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM;IAWpC,MAAM,CAAC,WAAW,CAAC,OAAO,SAAS,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO;IAWnG,MAAM,CAAC,gBAAgB,CAAC,OAAO,SAAS,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE;IAW1G,MAAM,CAAC,uBAAuB,CAAC,OAAO,SAAS,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO;IAiEhH,MAAM,CAAC,4BAA4B,CAAC,OAAO,SAAS,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,OAAO,EAAE;CAS3H"}
@@ -1,5 +1,6 @@
1
1
  import { DerivedType } from './DerivedType.js';
2
2
  import { registerModuleInstance } from './duplicateInstanceGuard.js';
3
+ import { Field } from './Field.js';
3
4
  import { Fields } from './Fields.js';
4
5
  import { declaredTypeKey, typeKeyOf, conceptAsTypeKey, valueMapTypeKey } from './typeKey.js';
5
6
  import { ValueMap } from './ValueMap.js';
@@ -72,7 +73,8 @@ const serializeValueForType = (type, value) => {
72
73
  };
73
74
  const deserializeValueFromType = (type, value) => {
74
75
  if (isConceptAs(type)) {
75
- return new type(value);
76
+ const valueType = type.valueType;
77
+ return new type(valueType ? deserializeValueFromType(valueType, value) : value);
76
78
  }
77
79
  const converter = converterFor(type);
78
80
  if (converter) {
@@ -88,7 +90,7 @@ const deserializeValueFromField = (field, value) => {
88
90
  return deserializeValueMapFromField(field, value);
89
91
  }
90
92
  if (isConceptAs(field.type)) {
91
- return new field.type(value);
93
+ return deserializeValueFromType(field.type, value);
92
94
  }
93
95
  const converter = converterFor(field.type);
94
96
  if (converter) {
@@ -208,21 +210,28 @@ class JsonSerializer {
208
210
  }
209
211
  static deserializeFromInstance(targetType, instance) {
210
212
  const fields = Fields.getFieldsForType(targetType);
211
- if (converterFor(targetType)) {
213
+ if (converterFor(targetType) || isConceptAs(targetType)) {
212
214
  return deserializeValueFromType(targetType, instance);
213
215
  }
214
216
  const deserialized = new targetType();
215
217
  for (const field of fields) {
216
218
  let value = instance[field.name];
217
- if (value) {
218
- if (field.enumerable) {
219
+ if (value !== undefined && value !== null) {
220
+ if (field.type === Array) {
221
+ const elementType = field.genericArguments[0];
222
+ if (elementType) {
223
+ const elementField = new Field(field.name, elementType, false, field.derivatives, []);
224
+ value = value.map(_ => deserializeValueFromField(elementField, _));
225
+ }
226
+ }
227
+ else if (field.enumerable) {
219
228
  value = value.map(_ => deserializeValueFromField(field, _));
220
229
  }
221
230
  else {
222
231
  value = deserializeValueFromField(field, value);
223
232
  }
224
233
  }
225
- else if (field.enumerable && value === undefined) {
234
+ else if ((field.enumerable || field.type === Array) && value === undefined) {
226
235
  value = [];
227
236
  }
228
237
  deserialized[field.name] = value;
@@ -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 { conceptAsTypeKey, declaredTypeKey, 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 return new type(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 new 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 return JsonSerializer.serialize(key);\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 // 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 */\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)) {\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) {\n if (field.enumerable) {\n value = value.map(_ => deserializeValueFromField(field, _));\n } else {\n value = deserializeValueFromField(field, value);\n }\n } else if (field.enumerable && 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":";;;;;;;;;;;;;;;AAgCA,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,C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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 { conceptAsTypeKey, declaredTypeKey, 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 return JsonSerializer.serialize(key);\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 // 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 */\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":";;;;;;;;;;;;;;;;AAgCA,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,IA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Y;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 +1 @@
1
- {"version":3,"file":"StandardClassDecoratorContext.d.ts","sourceRoot":"","sources":["../../StandardClassDecoratorContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C,MAAM,MAAM,6BAA6B,CAAC,MAAM,SAAS,WAAW,IAAI;IACpE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC5D,cAAc,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;CAC7D,CAAC"}
1
+ {"version":3,"file":"StandardClassDecoratorContext.d.ts","sourceRoot":"","sources":["../../StandardClassDecoratorContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C,MAAM,MAAM,6BAA6B,CAAC,MAAM,SAAS,WAAW,IAAI;IACpE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC5D,cAAc,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;CAC7D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StandardFieldDecoratorContext.d.ts","sourceRoot":"","sources":["../../StandardFieldDecoratorContext.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,6BAA6B,GAAG;IACxC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC/D,CAAC"}
1
+ {"version":3,"file":"StandardFieldDecoratorContext.d.ts","sourceRoot":"","sources":["../../StandardFieldDecoratorContext.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,6BAA6B,GAAG;IACxC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC/D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"fieldDecorator.d.ts","sourceRoot":"","sources":["../../fieldDecorator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF,KAAK,YAAY,GAAG;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,WAAW,EAAE,CAAC;CACpC,CAAC;AAMF,wBAAgB,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,mBAAmB,CAAC,EAAE,OAAO,GAAG,YAAY,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,EAAE,gBAAgB,CAAC,EAAE,WAAW,EAAE;aAK3H,MAAM,eAAe,MAAM,GAAG,IAAI;mBAC5B,SAAS,WAAW,6BAA6B,GAAG,IAAI;EAgC5F"}
1
+ {"version":3,"file":"fieldDecorator.d.ts","sourceRoot":"","sources":["../../fieldDecorator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAMhF,KAAK,YAAY,GAAG;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,WAAW,EAAE,CAAC;CACpC,CAAC;AAMF,wBAAgB,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,mBAAmB,CAAC,EAAE,OAAO,GAAG,YAAY,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,EAAE,gBAAgB,CAAC,EAAE,WAAW,EAAE;aAK3H,MAAM,eAAe,MAAM,GAAG,IAAI;mBAC5B,SAAS,WAAW,6BAA6B,GAAG,IAAI;EAgC5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"fieldDecorator.js","sources":["../../fieldDecorator.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 { Field } from './Field';\nimport { Fields } from './Fields';\nimport { addFieldToDecoratorMetadata } from './fieldDecoratorMetadata';\nimport { StandardFieldDecoratorContext } from './StandardFieldDecoratorContext';\n\ntype fieldOptions = {\n enumerable?: boolean;\n derivatives?: Constructor[];\n genericArguments?: Constructor[];\n};\n\nconst isFieldOptions = (value: boolean | fieldOptions | undefined): value is fieldOptions => {\n return typeof value === 'object' && value !== null;\n};\n\nexport function field(targetType: Constructor, enumerableOrOptions?: boolean | fieldOptions, derivatives?: Constructor[], genericArguments?: Constructor[]) {\n const enumerable = isFieldOptions(enumerableOrOptions) ? (enumerableOrOptions.enumerable || false) : (enumerableOrOptions || false);\n const actualDerivatives = isFieldOptions(enumerableOrOptions) ? (enumerableOrOptions.derivatives || []) : (derivatives || []);\n const actualGenericArguments = isFieldOptions(enumerableOrOptions) ? (enumerableOrOptions.genericArguments || []) : (genericArguments || []);\n\n function decorator(target: object, propertyKey: string): void;\n function decorator(initialValue: undefined, context: StandardFieldDecoratorContext): void;\n function decorator(targetOrInitialValue: object | undefined, propertyKeyOrContext: string | symbol | StandardFieldDecoratorContext): void {\n if (typeof propertyKeyOrContext === 'object' && propertyKeyOrContext !== null) {\n if (targetOrInitialValue !== undefined) throw new TypeError('@field received an invalid standard field value');\n addStandardField(propertyKeyOrContext);\n return;\n }\n\n addLegacyField(targetOrInitialValue, propertyKeyOrContext);\n }\n\n function addStandardField(context: StandardFieldDecoratorContext): void {\n if (context.kind !== 'field') throw new TypeError('@field can only decorate fields');\n if (context.static) throw new TypeError('@field cannot decorate static fields');\n if (context.private) throw new TypeError('@field cannot decorate private fields');\n if (typeof context.name !== 'string') throw new TypeError('@field cannot decorate symbol-named fields');\n if (!context.metadata) throw new TypeError('@field requires standard decorator metadata support');\n\n addFieldToDecoratorMetadata(\n context.metadata,\n new Field(context.name, targetType, enumerable, actualDerivatives, actualGenericArguments));\n }\n\n function addLegacyField(target: object | undefined, propertyKey: string | symbol): void {\n if (typeof propertyKey === 'symbol') throw new TypeError('@field cannot decorate symbol-named fields');\n if (typeof propertyKey !== 'string') throw new TypeError('@field received an invalid legacy decorator invocation');\n if (!target || typeof target === 'function') throw new TypeError('@field cannot decorate static fields');\n\n Fields.addFieldToType(target.constructor as Constructor, propertyKey, targetType, enumerable, actualDerivatives, actualGenericArguments);\n }\n\n return decorator;\n}\n"],"names":[],"mappings":";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CAAC,IAAI,KAAK,QAAQ;AAAE,YAAA,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC;QACvG,IAAI,CAAC,OAAO,CAAC,QAAQ;AAAE,YAAA,MAAM,IAAI,SAAS,CAAC,qDAAqD,CAAC;QAEjG,2BAA2B,CACvB,OAAO,CAAC,QAAQ,EAChB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,sBAAsB,CAAC,CAAC;IACnG;AAEA,IAAA,SAAS,cAAc,CAAC,MAA0B,EAAE,WAA4B,EAAA;QAC5E,IAAI,OAAO,WAAW,KAAK,QAAQ;AAAE,YAAA,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC;QACtG,IAAI,OAAO,WAAW,KAAK,QAAQ;AAAE,YAAA,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC;AAClH,QAAA,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,UAAU;AAAE,YAAA,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC;AAExG,QAAA,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAA0B,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,sBAAsB,CAAC;IAC5I;AAEA,IAAA,OAAO,SAAS;AACpB;;"}
1
+ {"version":3,"file":"fieldDecorator.js","sources":["../../fieldDecorator.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 { Field } from './Field';\nimport { Fields } from './Fields';\nimport { addFieldToDecoratorMetadata } from './fieldDecoratorMetadata';\nimport { StandardFieldDecoratorContext } from './StandardFieldDecoratorContext';\n\n/**\n * Serialization options for a decorated field's collection, derived, and generic types.\n * @inline\n */\ntype fieldOptions = {\n enumerable?: boolean;\n derivatives?: Constructor[];\n genericArguments?: Constructor[];\n};\n\nconst isFieldOptions = (value: boolean | fieldOptions | undefined): value is fieldOptions => {\n return typeof value === 'object' && value !== null;\n};\n\nexport function field(targetType: Constructor, enumerableOrOptions?: boolean | fieldOptions, derivatives?: Constructor[], genericArguments?: Constructor[]) {\n const enumerable = isFieldOptions(enumerableOrOptions) ? (enumerableOrOptions.enumerable || false) : (enumerableOrOptions || false);\n const actualDerivatives = isFieldOptions(enumerableOrOptions) ? (enumerableOrOptions.derivatives || []) : (derivatives || []);\n const actualGenericArguments = isFieldOptions(enumerableOrOptions) ? (enumerableOrOptions.genericArguments || []) : (genericArguments || []);\n\n function decorator(target: object, propertyKey: string): void;\n function decorator(initialValue: undefined, context: StandardFieldDecoratorContext): void;\n function decorator(targetOrInitialValue: object | undefined, propertyKeyOrContext: string | symbol | StandardFieldDecoratorContext): void {\n if (typeof propertyKeyOrContext === 'object' && propertyKeyOrContext !== null) {\n if (targetOrInitialValue !== undefined) throw new TypeError('@field received an invalid standard field value');\n addStandardField(propertyKeyOrContext);\n return;\n }\n\n addLegacyField(targetOrInitialValue, propertyKeyOrContext);\n }\n\n function addStandardField(context: StandardFieldDecoratorContext): void {\n if (context.kind !== 'field') throw new TypeError('@field can only decorate fields');\n if (context.static) throw new TypeError('@field cannot decorate static fields');\n if (context.private) throw new TypeError('@field cannot decorate private fields');\n if (typeof context.name !== 'string') throw new TypeError('@field cannot decorate symbol-named fields');\n if (!context.metadata) throw new TypeError('@field requires standard decorator metadata support');\n\n addFieldToDecoratorMetadata(\n context.metadata,\n new Field(context.name, targetType, enumerable, actualDerivatives, actualGenericArguments));\n }\n\n function addLegacyField(target: object | undefined, propertyKey: string | symbol): void {\n if (typeof propertyKey === 'symbol') throw new TypeError('@field cannot decorate symbol-named fields');\n if (typeof propertyKey !== 'string') throw new TypeError('@field received an invalid legacy decorator invocation');\n if (!target || typeof target === 'function') throw new TypeError('@field cannot decorate static fields');\n\n Fields.addFieldToType(target.constructor as Constructor, propertyKey, targetType, enumerable, actualDerivatives, actualGenericArguments);\n }\n\n return decorator;\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UAAU,EAAE,WAAW,EAAE,mBAAmB,CAAC,EAAE,OAAO,GAAG,YAAY,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,EAAE,gBAAgB,CAAC,EAAE,WAAW,EAAE;aAK3H,MAAM,eAAe,MAAM,GAAG,IAAI;mBAC5B,SAAS,WAAW,6BAA6B,GAAG,IAAI;EAgC5F"}
1
+ {"version":3,"file":"fieldDecorator.d.ts","sourceRoot":"","sources":["../fieldDecorator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAMhF,KAAK,YAAY,GAAG;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,WAAW,EAAE,CAAC;CACpC,CAAC;AAMF,wBAAgB,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,mBAAmB,CAAC,EAAE,OAAO,GAAG,YAAY,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,EAAE,gBAAgB,CAAC,EAAE,WAAW,EAAE;aAK3H,MAAM,eAAe,MAAM,GAAG,IAAI;mBAC5B,SAAS,WAAW,6BAA6B,GAAG,IAAI;EAgC5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"fieldDecorator.js","sourceRoot":"","sources":["../fieldDecorator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AASvE,MAAM,cAAc,GAAG,CAAC,KAAyC,EAAyB,EAAE;IACxF,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,UAAU,KAAK,CAAC,UAAuB,EAA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S,CAAC,4CAA4C,CAAC,CAAC;QACxG,IAAI,CAAC,OAAO,CAAC,QAAQ;YAAE,MAAM,IAAI,SAAS,CAAC,qDAAqD,CAAC,CAAC;QAElG,2BAA2B,CACvB,OAAO,CAAC,QAAQ,EAChB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,sBAAsB,CAAC,CAAC,CAAC;IACpG,CAAC;IAED,SAAS,cAAc,CAAC,MAA0B,EAAE,WAA4B;QAC5E,IAAI,OAAO,WAAW,KAAK,QAAQ;YAAE,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAC;QACvG,IAAI,OAAO,WAAW,KAAK,QAAQ;YAAE,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC,CAAC;QACnH,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,UAAU;YAAE,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAC;QAEzG,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAA0B,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,sBAAsB,CAAC,CAAC;IAC7I,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC"}
@@ -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":"4be4109ece9fb3a502363e428d4b9d09","signature":"05d855d5235efc2be94c1a4393c609e4","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":"8cb7338bc777318769ace0e9047dbaf0","signature":"56e1e5e440c94e1e1d7f6e87e79ad79a","impliedNodeFormat":1},{"version":"47b87a363745b24bd25a5f1a06112a09","signature":"613a934507b0cfd0950cb8e6973dfedf","impliedNodeFormat":1},{"version":"7d5608dd807efb8d47c2d2c1d51a6406","signature":"bad057a4b4ea4af9b6014d316293750a","impliedNodeFormat":1},{"version":"b361021d3d18d13aac63b35d4b0ef1d1","signature":"e574772f7137c7acb41b9b4cf9df058d","impliedNodeFormat":1},{"version":"74e5b2c5fc08d355ab0aa9d47e82f823","signature":"38aed49039f4cd461d25f012f97b8c39","impliedNodeFormat":1},{"version":"bdf78ed19f2852bc5589293a4e24b676","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":"e399c2749f7860a89efb559dc3ab8650","signature":"619e7562793b95efc8e4045b345c2958","impliedNodeFormat":1},{"version":"90afd3587a9a35670427e6961c843453","signature":"5c86fabce3450c64974c38377a4c7e78","impliedNodeFormat":1},{"version":"88e8ac668c482d4adea78be66563f1df","signature":"44105eab8a75458fcab12433d5d313c3","impliedNodeFormat":1},{"version":"975510ec28b104338b0200ad7da6681a","signature":"94ffea549c13e56a8cf4c04a811cbc75","impliedNodeFormat":1},{"version":"2fe2912e2a6fbdd8a4c6a47424358cbe","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,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","../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":"4be4109ece9fb3a502363e428d4b9d09","signature":"05d855d5235efc2be94c1a4393c609e4","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":"e428199a69f1b0f1eae01bcc82cf6f0e","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,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"}
package/fieldDecorator.ts CHANGED
@@ -7,6 +7,10 @@ import { Fields } from './Fields';
7
7
  import { addFieldToDecoratorMetadata } from './fieldDecoratorMetadata';
8
8
  import { StandardFieldDecoratorContext } from './StandardFieldDecoratorContext';
9
9
 
10
+ /**
11
+ * Serialization options for a decorated field's collection, derived, and generic types.
12
+ * @inline
13
+ */
10
14
  type fieldOptions = {
11
15
  enumerable?: boolean;
12
16
  derivatives?: Constructor[];
@@ -27,7 +27,6 @@ export class OtherType {
27
27
  collectionOfNumbers!: number[];
28
28
  }
29
29
 
30
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
31
30
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
32
31
  export interface ITargetType { }
33
32
 
@@ -0,0 +1,63 @@
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 { ConceptAs } from '../../ConceptAs';
5
+ import { field } from '../../fieldDecorator';
6
+ import { Guid } from '../../Guid';
7
+
8
+ export class Identifier extends ConceptAs<Guid> {
9
+ static readonly valueType = Guid;
10
+ }
11
+
12
+ export class Label extends ConceptAs<string> {}
13
+ export class Quantity extends ConceptAs<number> {}
14
+ export class Enabled extends ConceptAs<boolean> {}
15
+
16
+ export class Child {
17
+ @field(Identifier)
18
+ identifier!: Identifier;
19
+ }
20
+
21
+ export class Document {
22
+ @field(Array, { genericArguments: [String] })
23
+ names!: string[];
24
+
25
+ @field(Identifier)
26
+ identifier!: Identifier;
27
+
28
+ @field(Label)
29
+ label!: Label;
30
+
31
+ @field(Quantity)
32
+ quantity!: Quantity;
33
+
34
+ @field(Enabled)
35
+ enabled!: Enabled;
36
+
37
+ @field(Child)
38
+ child!: Child;
39
+
40
+ @field(Array, { genericArguments: [Identifier] })
41
+ identifiers!: Identifier[];
42
+
43
+ @field(Array, { genericArguments: [Child] })
44
+ children!: Child[];
45
+
46
+ @field(Label, true)
47
+ legacyLabels!: Label[];
48
+ }
49
+
50
+ export class a_model_with_field_metadata {
51
+ readonly identifier = 'f0fa7c5e-9f7b-4688-8851-e0b6eeebe28b';
52
+ readonly payload = {
53
+ names: ['one', 'two'],
54
+ identifier: this.identifier,
55
+ label: '',
56
+ quantity: 0,
57
+ enabled: false,
58
+ child: { identifier: this.identifier },
59
+ identifiers: [this.identifier],
60
+ children: [{ identifier: this.identifier }],
61
+ legacyLabels: ['older']
62
+ };
63
+ }
@@ -0,0 +1,6 @@
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
+ export function given<T>(contextType: new () => T, specification: (context: T) => void): () => void {
5
+ return () => specification(new contextType());
6
+ }
@@ -0,0 +1,41 @@
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 { given } from './given/given';
5
+ import { JsonSerializer } from '../JsonSerializer';
6
+ import { Guid } from '../Guid';
7
+ import { Child, Document, Enabled, Identifier, Label, Quantity, a_model_with_field_metadata } from './given/a_model_with_field_metadata';
8
+
9
+ describe('when deserializing fields with legacy decorators', given(a_model_with_field_metadata, context => {
10
+ let result: Document;
11
+
12
+ beforeEach(() => {
13
+ result = JsonSerializer.deserialize(Document, JSON.stringify(context.payload));
14
+ });
15
+
16
+ it('should read array elements declared through generic arguments', () => result.names.should.deep.equal(['one', 'two']));
17
+ it('should read a concept underlying Guid as a Guid', () => result.identifier.value.should.be.instanceOf(Guid));
18
+ it('should retain the concept underlying Guid value', () => result.identifier.value.toString().should.equal(context.identifier));
19
+ it('should wrap an empty string in its concept', () => {
20
+ result.label.should.be.instanceOf(Label);
21
+ result.label.value.should.equal('');
22
+ });
23
+ it('should wrap zero in its concept', () => {
24
+ result.quantity.should.be.instanceOf(Quantity);
25
+ result.quantity.value.should.equal(0);
26
+ });
27
+ it('should wrap false in its concept', () => {
28
+ result.enabled.should.be.instanceOf(Enabled);
29
+ result.enabled.value.should.equal(false);
30
+ });
31
+ it('should deserialize a nested model and its concept', () => {
32
+ result.child.should.be.instanceOf(Child);
33
+ result.child.identifier.value.should.be.instanceOf(Guid);
34
+ });
35
+ it('should deserialize an array of concepts', () => {
36
+ result.identifiers[0].should.be.instanceOf(Identifier);
37
+ result.identifiers[0].value.should.be.instanceOf(Guid);
38
+ });
39
+ it('should deserialize an array of nested models', () => result.children[0].should.be.instanceOf(Child));
40
+ it('should keep reading legacy enumerable concept fields', () => result.legacyLabels[0].value.should.equal('older'));
41
+ }));