@cratis/fundamentals 7.19.2 → 7.19.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/DateOnly.ts CHANGED
@@ -101,6 +101,17 @@ export class DateOnly {
101
101
  return `${this.year.toString().padStart(4, '0')}-${month}-${day}`;
102
102
  }
103
103
 
104
+ /**
105
+ * Gets the ISO-8601 representation used when this is serialized as JSON.
106
+ *
107
+ * Without this, `JSON.stringify` falls back to enumerating `year`, `month` and `day`, so a
108
+ * request body carries a component object where the server expects the scalar string.
109
+ * @returns The string.
110
+ */
111
+ toJSON(): string {
112
+ return this.toString();
113
+ }
114
+
104
115
  /**
105
116
  * Determines whether this is the same calendar date as another.
106
117
  * @param other The other date.
package/TimeOnly.ts CHANGED
@@ -93,6 +93,18 @@ export class TimeOnly {
93
93
  return this.millisecond > 0 ? `${time}.${this.millisecond.toString().padStart(3, '0')}` : time;
94
94
  }
95
95
 
96
+ /**
97
+ * Gets the ISO-8601 representation used when this is serialized as JSON.
98
+ *
99
+ * Without this, `JSON.stringify` falls back to enumerating `hour`, `minute`, `second` and
100
+ * `millisecond`, so a request body carries a component object where the server expects the
101
+ * scalar string.
102
+ * @returns The string.
103
+ */
104
+ toJSON(): string {
105
+ return this.toString();
106
+ }
107
+
96
108
  /**
97
109
  * Determines whether this is the same time of day as another.
98
110
  * @param other The other time.
@@ -9,6 +9,7 @@ export declare class DateOnly {
9
9
  static fromDate(date: Date): DateOnly;
10
10
  toDate(): Date;
11
11
  toString(): string;
12
+ toJSON(): string;
12
13
  equals(other: DateOnly | undefined | null): boolean;
13
14
  }
14
15
  //# sourceMappingURL=DateOnly.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateOnly.d.ts","sourceRoot":"","sources":["../DateOnly.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,qBAAa,QAAQ;IACjB,MAAM,CAAC,QAAQ,CAAC,C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ACJ"}
package/dist/DateOnly.js CHANGED
@@ -32,6 +32,9 @@ export class DateOnly {
32
32
  const day = this.day.toString().padStart(2, '0');
33
33
  return `${this.year.toString().padStart(4, '0')}-${month}-${day}`;
34
34
  }
35
+ toJSON() {
36
+ return this.toString();
37
+ }
35
38
  equals(other) {
36
39
  return !!other && this.year === other.year && this.month === other.month && this.day === other.day;
37
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DateOnly.js","sourceRoot":"","sources":["../DateOnly.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAclD,MAAM,OAAO,QAAQ;IACjB,MAAM,CAAU,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC;IAMvC,IAAI,CAAU;IAMd,KAAK,CAAU;IAMf,GAAG,CAAU;IASb,MAAM,CAAC,IAAI,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW;QAChD,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAChC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;QACvB,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC;QACnB,OAAO,QAAQ,CAAC;IACpB,CAAC;IAOD,MAAM,CAAC,KAAK,CAAC,KAAa;QACtB,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,EAAE,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,E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AI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC;IAMD,QAAQ;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACrD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACjD,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC;IACtE,CAAC;IASD,MAAM;QACF,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAOD,MAAM,CAAC,KAAkC;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,CAAC;IACvG,CAAC;CACJ;AA/FG;IADC,KAAK,CAAC,MAAM,CAAC;;sCACA;AAMd;IADC,KAAK,CAAC,MAAM,CAAC;;uCACC;AAMf;IADC,KAAK,CAAC,MAAM,CAAC;;qCACD"}
@@ -8,6 +8,7 @@ export declare class TimeOnly {
8
8
  static from(hour: number, minute: number, second?: number, millisecond?: number): TimeOnly;
9
9
  static parse(value: string): TimeOnly;
10
10
  toString(): string;
11
+ toJSON(): string;
11
12
  equals(other: TimeOnly | undefined | null): boolean;
12
13
  }
13
14
  //# sourceMappingURL=TimeOnly.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeOnly.d.ts","sourceRoot":"","sources":["../TimeOnly.ts"],"names":[],"mappings":"AAIA,OAAO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OAAO,CAMlD;CACJ"}
package/dist/TimeOnly.js CHANGED
@@ -31,6 +31,9 @@ export class TimeOnly {
31
31
  const time = `${hour}:${minute}:${second}`;
32
32
  return this.millisecond > 0 ? `${time}.${this.millisecond.toString().padStart(3, '0')}` : time;
33
33
  }
34
+ toJSON() {
35
+ return this.toString();
36
+ }
34
37
  equals(other) {
35
38
  return !!other &&
36
39
  this.hour === other.hour &&
@@ -1 +1 @@
1
- {"version":3,"file":"TimeOnly.js","sourceRoot":"","sources":["../TimeOnly.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,aAAa,GAAG,gDAAgD,CAAC;AASvE,MAAM,OAAO,QAAQ;IACjB,MAAM,CAAU,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC;IAMvC,IAAI,CAAU;IAMd,MAAM,CAAU;IAMhB,MAAM,CAAU;IAMhB,WAAW,CAAU;IAUrB,MAAM,CAAC,IAAI,CAAC,IAAY,EAAE,MAAc,EAAE,MAAM,GAAW,CAAC,EAAE,WAAW,GAAW,CAAC;QACjF,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAChC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;QACnC,OAAO,QAAQ,CAAC;IACpB,CAAC;IAWD,MAAM,CAAC,KAAK,CAAC,KAAa;QACtB,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,EAAE,CAAC,CAAC;QACzD,CAAC;QAED,MAAM,QAAQ,GA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CAAC,CAAC,IAAI,CAAC;IACnG,CAAC;IAUD,MAAM;QACF,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAOD,MAAM,CAAC,KAAkC;QACrC,OAAO,CAAC,CAAC,KAAK;YACV,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;YACxB,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;YAC5B,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;YAC5B,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW,CAAC;IAC/C,CAAC;CACJ;AAjGG;IADC,KAAK,CAAC,MAAM,CAAC;;sCACA;AAMd;IADC,KAAK,CAAC,MAAM,CAAC;;wCACE;AAMhB;IADC,KAAK,CAAC,MAAM,CAAC;;wCACE;AAMhB;IADC,KAAK,CAAC,MAAM,CAAC;;6CACO"}
@@ -9,6 +9,7 @@ export declare class DateOnly {
9
9
  static fromDate(date: Date): DateOnly;
10
10
  toDate(): Date;
11
11
  toString(): string;
12
+ toJSON(): string;
12
13
  equals(other: DateOnly | undefined | null): boolean;
13
14
  }
14
15
  //# sourceMappingURL=DateOnly.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateOnly.d.ts","sourceRoot":"","sources":["../../DateOnly.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,qBAAa,QAAQ;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,cAAc;IAMvC,IAAI,EAAG,MAAM,CAAC;IAMd,KAAK,EAAG,MAAM,CAAC;IAMf,GAAG,EAAG,MAAM,CAAC;IASb,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ;IAa/D,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ;IAiBrC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ;IAWrC,MAAM,IAAI,IAAI;IAQd,QAAQ,IAAI,MAAM;IAWlB,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO;CAGtD"}
1
+ {"version":3,"file":"DateOnly.d.ts","sourceRoot":"","sources":["../../DateOnly.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,qBAAa,QAAQ;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,cAAc;IAMvC,IAAI,EAAG,MAAM,CAAC;IAMd,KAAK,EAAG,MAAM,CAAC;IAMf,GAAG,EAAG,MAAM,CAAC;IASb,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ;IAa/D,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ;IAiBrC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ;IAWrC,MAAM,IAAI,IAAI;IAQd,QAAQ,IAAI,MAAM;IAalB,MAAM,IAAI,MAAM;IAShB,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO;CAGtD"}
@@ -35,6 +35,9 @@ class DateOnly {
35
35
  const day = this.day.toString().padStart(2, '0');
36
36
  return `${this.year.toString().padStart(4, '0')}-${month}-${day}`;
37
37
  }
38
+ toJSON() {
39
+ return this.toString();
40
+ }
38
41
  equals(other) {
39
42
  return !!other && this.year === other.year && this.month === other.month && this.day === other.day;
40
43
  }
@@ -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 * 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":["typeKey","__decorate","field"],"mappings":";;;;;;AAMA,MAAM,aAAa,GAAG,2BAA2B;MAcpC,QAAQ,CAAA;AACjB,IAAA,QAAiBA,eAAO,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,CAAC,KAAa,EAAA;QACtB,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;AACvC,QAAA,IAAI,KAAK,KAAK,IAAI,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,CAAA,CAAE,CAAC;QACxD;AAEA,QAAA,OAAO,QAA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,QAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAMdD,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAMfD,iBAAA,CAAA;IADCC,oBAAK,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 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":["typeKey","__decorate","field"],"mappings":";;;;;;AAMA,MAAM,aAAa,GAAG,2BAA2B;MAcpC,QAAQ,CAAA;AACjB,IAAA,QA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AC,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;;AA9FAC,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACA,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAMdD,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACC,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAMfD,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACD,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,KAAA,EAAA,MAAA,CAAA;;"}
@@ -8,6 +8,7 @@ export declare class TimeOnly {
8
8
  static from(hour: number, minute: number, second?: number, millisecond?: number): TimeOnly;
9
9
  static parse(value: string): TimeOnly;
10
10
  toString(): string;
11
+ toJSON(): string;
11
12
  equals(other: TimeOnly | undefined | null): boolean;
12
13
  }
13
14
  //# sourceMappingURL=TimeOnly.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeOnly.d.ts","sourceRoot":"","sources":["../../TimeOnly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tD"}
@@ -34,6 +34,9 @@ class TimeOnly {
34
34
  const time = `${hour}:${minute}:${second}`;
35
35
  return this.millisecond > 0 ? `${time}.${this.millisecond.toString().padStart(3, '0')}` : time;
36
36
  }
37
+ toJSON() {
38
+ return this.toString();
39
+ }
37
40
  equals(other) {
38
41
  return !!other &&
39
42
  this.hour === other.hour &&
@@ -1 +1 @@
1
- {"version":3,"file":"TimeOnly.js","sources":["../../TimeOnly.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 timeOnlyRegex = /^(\\d{2}):(\\d{2})(?::(\\d{2}))?(?:\\.(\\d{1,7}))?$/;\n\n/**\n * Represents a time of day with no date and no time zone.\n * @remarks\n * Deliberately not a JavaScript `Date`. A `Date` needs a date, and a time of day has none: `new Date('14:30:45')`\n * is not an instant pinned to some default day, it is `Invalid Date`. The value is destroyed outright rather than\n * merely shifted, which makes this the starker of the two temporal cases.\n */\nexport class TimeOnly {\n static readonly [typeKey] = 'TimeOnly';\n\n /**\n * The hour, 0 through 23.\n */\n @field(Number)\n hour!: number;\n\n /**\n * The minute, 0 through 59.\n */\n @field(Number)\n minute!: number;\n\n /**\n * The second, 0 through 59.\n */\n @field(Number)\n second!: number;\n\n /**\n * The millisecond, 0 through 999.\n */\n @field(Number)\n millisecond!: number;\n\n /**\n * Creates a {@link TimeOnly} from its parts.\n * @param hour The hour.\n * @param minute The minute.\n * @param second The second.\n * @param millisecond The millisecond.\n * @returns The {@link TimeOnly}.\n */\n static from(hour: number, minute: number, second: number = 0, millisecond: number = 0): TimeOnly {\n const timeOnly = new TimeOnly();\n timeOnly.hour = hour;\n timeOnly.minute = minute;\n timeOnly.second = second;\n timeOnly.millisecond = millisecond;\n return timeOnly;\n }\n\n /**\n * Parses the ISO-8601 time of day the server sends, `HH:mm`, `HH:mm:ss` or `HH:mm:ss.fffffff`.\n * @param value The value to parse.\n * @returns The {@link TimeOnly}.\n * @remarks\n * The seconds and the fraction are both optional because the server omits them when they are zero, and the\n * fraction carries up to seven digits where JavaScript holds three - so it is truncated rather than rounded,\n * which keeps a parse followed by a render from moving the value forward.\n */\n static parse(value: string): TimeOnly {\n const match = timeOnlyRegex.exec(value);\n if (match === null) {\n throw new Error(`Invalid TimeOnly format: ${value}`);\n }\n\n const fraction = match[4] ? match[4].padEnd(3, '0').substring(0, 3) : '0';\n\n return TimeOnly.from(\n parseInt(match[1], 10),\n parseInt(match[2], 10),\n match[3] ? parseInt(match[3], 10) : 0,\n parseInt(fraction, 10));\n }\n\n /**\n * Gets the ISO-8601 representation, `HH:mm:ss` - or `HH:mm:ss.fff` when there is a fractional part.\n * @returns The string.\n */\n toString(): string {\n const hour = this.hour.toString().padStart(2, '0');\n const minute = this.minute.toString().padStart(2, '0');\n const second = this.second.toString().padStart(2, '0');\n const time = `${hour}:${minute}:${second}`;\n return this.millisecond > 0 ? `${time}.${this.millisecond.toString().padStart(3, '0')}` : time;\n }\n\n /**\n * Determines whether this is the same time of day as another.\n * @param other The other time.\n * @returns True when they are the same time.\n */\n equals(other: TimeOnly | undefined | null): boolean {\n return !!other &&\n this.hour === other.hour &&\n this.minute === other.minute &&\n this.second === other.second &&\n this.millisecond === other.millisecond;\n }\n}\n"],"names":["typeKey","__decorate","field"],"mappings":";;;;;;AAMA,MAAM,aAAa,GAAG,gDAAgD;MASzD,QAAQ,CAAA;AACjB,IAAA,QAAiBA,eAAO,IAAI,UAAU;AAMtC,IAAA,IAAI;AAMJ,IAAA,MAAM;AAMN,IAAA,MAAM;AAMN,IAAA,WAAW;IAUX,OAAO,IAAI,CAAC,IAAY,EAAE,MAAc,EAAE,MAAA,GAAiB,CAAC,EAAE,WAAA,GAAsB,CAAC,EAAA;AACjF,QAAA,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE;AAC/B,QAAA,QAAQ,CAAC,IAAI,GAAG,IAAI;AACpB,QAAA,QAAQ,C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,EAAG,IAAI,IAAI,MAAM,CAAA,CAAA,EAAI,MAAM,CAAA,CAAE;AAC1C,QAAA,OAAO,IAAI,CAAC,WAAW,GAAG,CAAC,GAAG,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA,CAAE,GAAG,IAAI;IAClG;AAOA,IAAA,MAAM,CAAC,KAAkC,EAAA;QACrC,OAAO,CAAC,CAAC,KAAK;AACV,YAAA,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;AACxB,YAAA,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;AAC5B,YAAA,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;AAC5B,YAAA,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW;IAC9C;;AApFAC,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACA,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAMdD,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACE,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAMhBD,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACE,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAMhBD,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACO,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;;"}
1
+ {"version":3,"file":"TimeOnly.js","sources":["../../TimeOnly.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 timeOnlyRegex = /^(\\d{2}):(\\d{2})(?::(\\d{2}))?(?:\\.(\\d{1,7}))?$/;\n\n/**\n * Represents a time of day with no date and no time zone.\n * @remarks\n * Deliberately not a JavaScript `Date`. A `Date` needs a date, and a time of day has none: `new Date('14:30:45')`\n * is not an instant pinned to some default day, it is `Invalid Date`. The value is destroyed outright rather than\n * merely shifted, which makes this the starker of the two temporal cases.\n */\nexport class TimeOnly {\n static readonly [typeKey] = 'TimeOnly';\n\n /**\n * The hour, 0 through 23.\n */\n @field(Number)\n hour!: number;\n\n /**\n * The minute, 0 through 59.\n */\n @field(Number)\n minute!: number;\n\n /**\n * The second, 0 through 59.\n */\n @field(Number)\n second!: number;\n\n /**\n * The millisecond, 0 through 999.\n */\n @field(Number)\n millisecond!: number;\n\n /**\n * Creates a {@link TimeOnly} from its parts.\n * @param hour The hour.\n * @param minute The minute.\n * @param second The second.\n * @param millisecond The millisecond.\n * @returns The {@link TimeOnly}.\n */\n static from(hour: number, minute: number, second: number = 0, millisecond: number = 0): TimeOnly {\n const timeOnly = new TimeOnly();\n timeOnly.hour = hour;\n timeOnly.minute = minute;\n timeOnly.second = second;\n timeOnly.millisecond = millisecond;\n return timeOnly;\n }\n\n /**\n * Parses the ISO-8601 time of day the server sends, `HH:mm`, `HH:mm:ss` or `HH:mm:ss.fffffff`.\n * @param value The value to parse.\n * @returns The {@link TimeOnly}.\n * @remarks\n * The seconds and the fraction are both optional because the server omits them when they are zero, and the\n * fraction carries up to seven digits where JavaScript holds three - so it is truncated rather than rounded,\n * which keeps a parse followed by a render from moving the value forward.\n */\n static parse(value: string): TimeOnly {\n const match = timeOnlyRegex.exec(value);\n if (match === null) {\n throw new Error(`Invalid TimeOnly format: ${value}`);\n }\n\n const fraction = match[4] ? match[4].padEnd(3, '0').substring(0, 3) : '0';\n\n return TimeOnly.from(\n parseInt(match[1], 10),\n parseInt(match[2], 10),\n match[3] ? parseInt(match[3], 10) : 0,\n parseInt(fraction, 10));\n }\n\n /**\n * Gets the ISO-8601 representation, `HH:mm:ss` - or `HH:mm:ss.fff` when there is a fractional part.\n * @returns The string.\n */\n toString(): string {\n const hour = this.hour.toString().padStart(2, '0');\n const minute = this.minute.toString().padStart(2, '0');\n const second = this.second.toString().padStart(2, '0');\n const time = `${hour}:${minute}:${second}`;\n return this.millisecond > 0 ? `${time}.${this.millisecond.toString().padStart(3, '0')}` : time;\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 `hour`, `minute`, `second` and\n * `millisecond`, so a request body carries a component object where the server expects the\n * scalar string.\n * @returns The string.\n */\n toJSON(): string {\n return this.toString();\n }\n\n /**\n * Determines whether this is the same time of day as another.\n * @param other The other time.\n * @returns True when they are the same time.\n */\n equals(other: TimeOnly | undefined | null): boolean {\n return !!other &&\n this.hour === other.hour &&\n this.minute === other.minute &&\n this.second === other.second &&\n this.millisecond === other.millisecond;\n }\n}\n"],"names":["typeKey","__decorate","field"],"mappings":";;;;;;AAMA,MAAM,aAAa,GAAG,gDAAgD;MASzD,QAAQ,CAAA;AACjB,IAAA,QAAiBA,eAAO,IAAI,UAAU;AAMtC,IAAA,IAAI;AAMJ,IAAA,MAAM;AAMN,IAAA,MAAM;AAMN,IAAA,WAAW;IAUX,OAAO,IAAI,CAAC,IAAY,EAAE,MAAc,EAAE,MAAA,GAAiB,CAAC,EAAE,WAAA,GAAsB,CAAC,EAAA;AACjF,QAAA,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE;AAC/B,QAAA,QAAQ,CAAC,IAAI,GAAG,IAAI;AACpB,QAAA,QAAQ,CAAC,MAAM,GAAG,MAAM;AACxB,QAAA,QAAQ,CAAC,MAAM,GAAG,MAAM;AACxB,QAAA,QAAQ,CAAC,WAAW,GAAG,WAAW;AAClC,QAAA,OAAO,QAAQ;IACnB;IAWA,OAAO,KAAK,CAAC,KAAa,EAAA;QACtB,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;AACvC,QAAA,IAAI,K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;IAClG;IAUA,MAAM,GAAA;AACF,QAAA,OAAO,IAAI,CAAC,QAAQ,EAAE;IAC1B;AAOA,IAAA,MAAM,CAAC,KAAkC,EAAA;QACrC,OAAO,CAAC,CAAC,KAAK;AACV,YAAA,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;AACxB,YAAA,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;AAC5B,YAAA,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;AAC5B,YAAA,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW;IAC9C;;AAhGAC,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACA,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAMdD,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACE,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAMhBD,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACE,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAMhBD,iBAAA,CAAA;IADCC,oBAAK,CAAC,MAAM,CAAC;;AACO,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;;"}
@@ -9,6 +9,7 @@ export declare class DateOnly {
9
9
  static fromDate(date: Date): DateOnly;
10
10
  toDate(): Date;
11
11
  toString(): string;
12
+ toJSON(): string;
12
13
  equals(other: DateOnly | undefined | null): boolean;
13
14
  }
14
15
  //# sourceMappingURL=DateOnly.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateOnly.d.ts","sourceRoot":"","sources":["../../DateOnly.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,qBAAa,QAAQ;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,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toString().padStart(4, '0')}-${month}-${day}`;
35
35
  }
36
+ toJSON() {
37
+ return this.toString();
38
+ }
36
39
  equals(other) {
37
40
  return !!other && this.year === other.year && this.month === other.month && this.day === other.day;
38
41
  }
@@ -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 * 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,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,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;;AAnFA,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 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":[],"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,CAAC,KAAa,EAAA;QACtB,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;AACvC,QAAA,IAAI,KAAK,KAAK,IAAI,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,CAAA,CAAE,CAAC;QACxD;AAEA,QAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChG;IAUA,OAAO,QAAQ,CAAC,IAAU,EAAA;QACtB,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IACjF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number, second?: number, millisecond?: number): TimeOnly;
9
9
  static parse(value: string): TimeOnly;
10
10
  toString(): string;
11
+ toJSON(): string;
11
12
  equals(other: TimeOnly | undefined | null): boolean;
12
13
  }
13
14
  //# sourceMappingURL=TimeOnly.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeOnly.d.ts","sourceRoot":"","sources":["../../TimeOnly.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,qBAAa,QAAQ;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,cAAc;IAMvC,IAAI,EAAG,MAAM,CAAC;IAMd,MAAM,EAAG,MAAM,CAAC;IAMhB,MAAM,EAAG,MAAM,CAAC;IAMhB,WAAW,EAAG,MAAM,CAAC;IAUrB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,MAAU,EAAE,WAAW,GAAE,MAAU,GAAG,QAAQ;IAkBhG,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ;IAmBrC,QAAQ,IAAI,MAAM;IAalB,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO;CAOtD"}
1
+ {"version":3,"file":"TimeOnly.d.ts","sourceRoot":"","sources":["../../TimeOnly.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,qBAAa,QAAQ;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,cAAc;IAMvC,IAAI,EAAG,MAAM,CAAC;IAMd,MAAM,EAAG,MAAM,CAAC;IAMhB,MAAM,EAAG,MAAM,CAAC;IAMhB,WAAW,EAAG,MAAM,CAAC;IAUrB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,MAAU,EAAE,WAAW,GAAE,MAAU,GAAG,QAAQ;IAkBhG,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ;IAmBrC,QAAQ,IAAI,MAAM;IAgBlB,MAAM,IAAI,MAAM;IAShB,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO;CAOtD"}
@@ -32,6 +32,9 @@ class TimeOnly {
32
32
  const time = `${hour}:${minute}:${second}`;
33
33
  return this.millisecond > 0 ? `${time}.${this.millisecond.toString().padStart(3, '0')}` : time;
34
34
  }
35
+ toJSON() {
36
+ return this.toString();
37
+ }
35
38
  equals(other) {
36
39
  return !!other &&
37
40
  this.hour === other.hour &&
@@ -1 +1 @@
1
- {"version":3,"file":"TimeOnly.js","sources":["../../TimeOnly.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 timeOnlyRegex = /^(\\d{2}):(\\d{2})(?::(\\d{2}))?(?:\\.(\\d{1,7}))?$/;\n\n/**\n * Represents a time of day with no date and no time zone.\n * @remarks\n * Deliberately not a JavaScript `Date`. A `Date` needs a date, and a time of day has none: `new Date('14:30:45')`\n * is not an instant pinned to some default day, it is `Invalid Date`. The value is destroyed outright rather than\n * merely shifted, which makes this the starker of the two temporal cases.\n */\nexport class TimeOnly {\n static readonly [typeKey] = 'TimeOnly';\n\n /**\n * The hour, 0 through 23.\n */\n @field(Number)\n hour!: number;\n\n /**\n * The minute, 0 through 59.\n */\n @field(Number)\n minute!: number;\n\n /**\n * The second, 0 through 59.\n */\n @field(Number)\n second!: number;\n\n /**\n * The millisecond, 0 through 999.\n */\n @field(Number)\n millisecond!: number;\n\n /**\n * Creates a {@link TimeOnly} from its parts.\n * @param hour The hour.\n * @param minute The minute.\n * @param second The second.\n * @param millisecond The millisecond.\n * @returns The {@link TimeOnly}.\n */\n static from(hour: number, minute: number, second: number = 0, millisecond: number = 0): TimeOnly {\n const timeOnly = new TimeOnly();\n timeOnly.hour = hour;\n timeOnly.minute = minute;\n timeOnly.second = second;\n timeOnly.millisecond = millisecond;\n return timeOnly;\n }\n\n /**\n * Parses the ISO-8601 time of day the server sends, `HH:mm`, `HH:mm:ss` or `HH:mm:ss.fffffff`.\n * @param value The value to parse.\n * @returns The {@link TimeOnly}.\n * @remarks\n * The seconds and the fraction are both optional because the server omits them when they are zero, and the\n * fraction carries up to seven digits where JavaScript holds three - so it is truncated rather than rounded,\n * which keeps a parse followed by a render from moving the value forward.\n */\n static parse(value: string): TimeOnly {\n const match = timeOnlyRegex.exec(value);\n if (match === null) {\n throw new Error(`Invalid TimeOnly format: ${value}`);\n }\n\n const fraction = match[4] ? match[4].padEnd(3, '0').substring(0, 3) : '0';\n\n return TimeOnly.from(\n parseInt(match[1], 10),\n parseInt(match[2], 10),\n match[3] ? parseInt(match[3], 10) : 0,\n parseInt(fraction, 10));\n }\n\n /**\n * Gets the ISO-8601 representation, `HH:mm:ss` - or `HH:mm:ss.fff` when there is a fractional part.\n * @returns The string.\n */\n toString(): string {\n const hour = this.hour.toString().padStart(2, '0');\n const minute = this.minute.toString().padStart(2, '0');\n const second = this.second.toString().padStart(2, '0');\n const time = `${hour}:${minute}:${second}`;\n return this.millisecond > 0 ? `${time}.${this.millisecond.toString().padStart(3, '0')}` : time;\n }\n\n /**\n * Determines whether this is the same time of day as another.\n * @param other The other time.\n * @returns True when they are the same time.\n */\n equals(other: TimeOnly | undefined | null): boolean {\n return !!other &&\n this.hour === other.hour &&\n this.minute === other.minute &&\n this.second === other.second &&\n this.millisecond === other.millisecond;\n }\n}\n"],"names":[],"mappings":";;;;AAMA,MAAM,aAAa,GAAG,gDAAgD;MASzD,QAAQ,CAAA;AACjB,IAAA,QAAiB,OAAO,IAAI,UAAU;AAMtC,IAAA,IAAI;AAMJ,IAAA,MAAM;AAMN,IAAA,MAAM;AAMN,IAAA,WAAW;I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+ {"version":3,"file":"TimeOnly.js","sources":["../../TimeOnly.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 timeOnlyRegex = /^(\\d{2}):(\\d{2})(?::(\\d{2}))?(?:\\.(\\d{1,7}))?$/;\n\n/**\n * Represents a time of day with no date and no time zone.\n * @remarks\n * Deliberately not a JavaScript `Date`. A `Date` needs a date, and a time of day has none: `new Date('14:30:45')`\n * is not an instant pinned to some default day, it is `Invalid Date`. The value is destroyed outright rather than\n * merely shifted, which makes this the starker of the two temporal cases.\n */\nexport class TimeOnly {\n static readonly [typeKey] = 'TimeOnly';\n\n /**\n * The hour, 0 through 23.\n */\n @field(Number)\n hour!: number;\n\n /**\n * The minute, 0 through 59.\n */\n @field(Number)\n minute!: number;\n\n /**\n * The second, 0 through 59.\n */\n @field(Number)\n second!: number;\n\n /**\n * The millisecond, 0 through 999.\n */\n @field(Number)\n millisecond!: number;\n\n /**\n * Creates a {@link TimeOnly} from its parts.\n * @param hour The hour.\n * @param minute The minute.\n * @param second The second.\n * @param millisecond The millisecond.\n * @returns The {@link TimeOnly}.\n */\n static from(hour: number, minute: number, second: number = 0, millisecond: number = 0): TimeOnly {\n const timeOnly = new TimeOnly();\n timeOnly.hour = hour;\n timeOnly.minute = minute;\n timeOnly.second = second;\n timeOnly.millisecond = millisecond;\n return timeOnly;\n }\n\n /**\n * Parses the ISO-8601 time of day the server sends, `HH:mm`, `HH:mm:ss` or `HH:mm:ss.fffffff`.\n * @param value The value to parse.\n * @returns The {@link TimeOnly}.\n * @remarks\n * The seconds and the fraction are both optional because the server omits them when they are zero, and the\n * fraction carries up to seven digits where JavaScript holds three - so it is truncated rather than rounded,\n * which keeps a parse followed by a render from moving the value forward.\n */\n static parse(value: string): TimeOnly {\n const match = timeOnlyRegex.exec(value);\n if (match === null) {\n throw new Error(`Invalid TimeOnly format: ${value}`);\n }\n\n const fraction = match[4] ? match[4].padEnd(3, '0').substring(0, 3) : '0';\n\n return TimeOnly.from(\n parseInt(match[1], 10),\n parseInt(match[2], 10),\n match[3] ? parseInt(match[3], 10) : 0,\n parseInt(fraction, 10));\n }\n\n /**\n * Gets the ISO-8601 representation, `HH:mm:ss` - or `HH:mm:ss.fff` when there is a fractional part.\n * @returns The string.\n */\n toString(): string {\n const hour = this.hour.toString().padStart(2, '0');\n const minute = this.minute.toString().padStart(2, '0');\n const second = this.second.toString().padStart(2, '0');\n const time = `${hour}:${minute}:${second}`;\n return this.millisecond > 0 ? `${time}.${this.millisecond.toString().padStart(3, '0')}` : time;\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 `hour`, `minute`, `second` and\n * `millisecond`, so a request body carries a component object where the server expects the\n * scalar string.\n * @returns The string.\n */\n toJSON(): string {\n return this.toString();\n }\n\n /**\n * Determines whether this is the same time of day as another.\n * @param other The other time.\n * @returns True when they are the same time.\n */\n equals(other: TimeOnly | undefined | null): boolean {\n return !!other &&\n this.hour === other.hour &&\n this.minute === other.minute &&\n this.second === other.second &&\n this.millisecond === other.millisecond;\n }\n}\n"],"names":[],"mappings":";;;;AAMA,MAAM,aAAa,GAAG,gDAAgD;MASzD,QAAQ,CAAA;AACjB,IAAA,QAAiB,OAAO,IAAI,UAAU;AAMtC,IAAA,IAAI;AAMJ,IAAA,MAAM;AAMN,IAAA,MAAM;AAMN,IAAA,WAAW;IAUX,OAAO,IAAI,CAAC,IAAY,EAAE,MAAc,EAAE,MAAA,GAAiB,CAAC,EAAE,WAAA,GAAsB,CAAC,EAAA;AACjF,QAAA,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE;AAC/B,QAAA,QAAQ,CAAC,IAAI,GAAG,IAAI;AACpB,QAAA,QAAQ,CAAC,MAAM,GAAG,MAAM;AACxB,QAAA,QAAQ,CAAC,MAAM,GAAG,MAAM;AACxB,QAAA,QA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IAAI,CAAC,WAAW,GAAG,CAAC,GAAG,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA,CAAE,GAAG,IAAI;IAClG;IAUA,MAAM,GAAA;AACF,QAAA,OAAO,IAAI,CAAC,QAAQ,EAAE;IAC1B;AAOA,IAAA,MAAM,CAAC,KAAkC,EAAA;QACrC,OAAO,CAAC,CAAC,KAAK;AACV,YAAA,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;AACxB,YAAA,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;AAC5B,YAAA,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;AAC5B,YAAA,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW;IAC9C;;AAhGA,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;;AACE,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAMhB,UAAA,CAAA;IADC,KAAK,CAAC,MAAM,CAAC;;AACE,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAMhB,UAAA,CAAA;IADC,KAAK,CAAC,MAAM,CAAC;;AACO,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;;"}
@@ -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":"73e14ad699ddfe32d0657409652c2e25","signature":"f0cfc9f746e0ddebba7a838525b9868c","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":"8cacd9b025b32ae3a637690ec4c6be8a","signature":"eae14d338956fa0c65f0989d61dcaf36","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":"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"}
@@ -0,0 +1,13 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { DateOnly } from '../DateOnly';
5
+
6
+ describe('when serializing it as json', () => {
7
+ const date = DateOnly.from(2026, 8, 30);
8
+ const serialized = JSON.stringify({ date });
9
+
10
+ it('should render the iso string directly', () => date.toJSON().should.equal('2026-08-30'));
11
+ it('should render the same as toString', () => date.toJSON().should.equal(date.toString()));
12
+ it('should be a scalar string inside a serialized object', () => serialized.should.equal('{"date":"2026-08-30"}'));
13
+ });
@@ -0,0 +1,15 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { TimeOnly } from '../TimeOnly';
5
+
6
+ describe('when serializing it as json', () => {
7
+ const withoutFraction = TimeOnly.from(14, 30, 45);
8
+ const withFraction = TimeOnly.from(14, 30, 45, 123);
9
+
10
+ it('should render the iso string directly', () => withoutFraction.toJSON().should.equal('14:30:45'));
11
+ it('should keep the fractional part', () => withFraction.toJSON().should.equal('14:30:45.123'));
12
+ it('should render the same as toString', () => withFraction.toJSON().should.equal(withFraction.toString()));
13
+ it('should be a scalar string inside a serialized object', () =>
14
+ JSON.stringify({ time: withFraction }).should.equal('{"time":"14:30:45.123"}'));
15
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/fundamentals",
3
- "version": "7.19.2",
3
+ "version": "7.19.3",
4
4
  "description": "The shared building blocks beneath the Cratis stack — GUIDs, concepts, derived-type serialization, property-path proxies, and decorators for TypeScript",
5
5
  "keywords": [
6
6
  "cratis",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "devDependencies": {
58
58
  "@typescript/native": "npm:typescript@^7.0.2",
59
- "rollup": "4.63.1",
59
+ "rollup": "4.63.3",
60
60
  "rollup-plugin-typescript2": "0.37.0",
61
61
  "typescript": "npm:@typescript/typescript6@^6.0.2",
62
62
  "typescript-programmatic-api": "npm:@typescript/typescript6@^6.0.2"