From cb8300c8e7993ab69f14b372e6859ba90c7c66b3 Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 21 Jul 2024 21:01:41 +1200 Subject: [PATCH] remove schema static annotations --- packages/schema/src/Schema.ts | 59 ++++++----------------------------- 1 file changed, 10 insertions(+), 49 deletions(-) diff --git a/packages/schema/src/Schema.ts b/packages/schema/src/Schema.ts index 23e493601c0..76defa70bbc 100644 --- a/packages/schema/src/Schema.ts +++ b/packages/schema/src/Schema.ts @@ -5762,10 +5762,7 @@ export class DateTimeUtcFromSelf extends declare( arbitrary: (): LazyArbitrary => (fc) => fc.date().map((date) => dateTime.unsafeFromDate(date)), equivalence: () => dateTime.Equivalence } -) { - static override annotations: (annotations: Annotations.Schema) => typeof DateTimeUtcFromSelf = super - .annotations -} +) {} const decodeDateTime = (input: A, _: ParseOptions, ast: AST.AST) => ParseResult.try({ @@ -5787,11 +5784,7 @@ export class DateTimeUtcFromNumber extends transformOrFail( decode: decodeDateTime, encode: (dt) => ParseResult.succeed(dateTime.toEpochMillis(dt)) } -).annotations({ identifier: "DateTimeUtcFromNumber" }) { - static override annotations: ( - annotations: Annotations.Schema - ) => typeof DateTimeUtcFromNumber = super.annotations -} +).annotations({ identifier: "DateTimeUtcFromNumber" }) {} /** * Defines a schema that attempts to convert a `string` to a `DateTime.Utc` instance using the `DateTime.unsafeMake` constructor. @@ -5807,11 +5800,7 @@ export class DateTimeUtc extends transformOrFail( decode: decodeDateTime, encode: (dt) => ParseResult.succeed(dateTime.formatIso(dt)) } -).annotations({ identifier: "DateTime.Utc" }) { - static override annotations: ( - annotations: Annotations.Schema - ) => typeof DateTimeUtc = super.annotations -} +).annotations({ identifier: "DateTime.Utc" }) {} const timeZoneOffsetArbitrary = (): LazyArbitrary => (fc) => fc.integer({ min: -12 * 60 * 60 * 1000, max: 12 * 60 * 60 * 1000 }).map((offset) => dateTime.zoneMakeOffset(offset)) @@ -5830,11 +5819,7 @@ export class TimeZoneOffsetFromSelf extends declare( pretty: (): pretty_.Pretty => (zone) => `TimeZone.Offset(${zone.offset})`, arbitrary: timeZoneOffsetArbitrary } -) { - static override annotations: ( - annotations: Annotations.Schema - ) => typeof TimeZoneOffsetFromSelf = super.annotations -} +) {} /** * Defines a schema that attempts to convert a `number` to a `TimeZone.Offset` instance using the `DateTime.zoneMakeOffset` constructor. @@ -5846,11 +5831,7 @@ export class TimeZoneOffset extends transform( Number$, TimeZoneOffsetFromSelf, { strict: true, decode: (n) => dateTime.zoneMakeOffset(n), encode: (tz) => tz.offset } -).annotations({ identifier: "TimeZoneOffset" }) { - static override annotations: ( - annotations: Annotations.Schema - ) => typeof TimeZoneOffset = super.annotations -} +).annotations({ identifier: "TimeZoneOffset" }) {} const timeZoneNamedArbitrary = (): LazyArbitrary => (fc) => fc.constantFrom(...Intl.supportedValuesOf("timeZone")).map((id) => dateTime.zoneUnsafeMakeNamed(id)) @@ -5869,11 +5850,7 @@ export class TimeZoneNamedFromSelf extends declare( pretty: (): pretty_.Pretty => (zone) => `TimeZone.Named(${zone.id})`, arbitrary: timeZoneNamedArbitrary } -) { - static override annotations: ( - annotations: Annotations.Schema - ) => typeof TimeZoneNamedFromSelf = super.annotations -} +) {} /** * Defines a schema that attempts to convert a `string` to a `TimeZone.Named` instance using the `DateTime.zoneUnsafeMakeNamed` constructor. @@ -5893,11 +5870,7 @@ export class TimeZoneNamed extends transformOrFail( }), encode: (tz) => ParseResult.succeed(tz.id) } -).annotations({ identifier: "TimeZoneNamed" }) { - static override annotations: ( - annotations: Annotations.Schema - ) => typeof TimeZoneNamed = super.annotations -} +).annotations({ identifier: "TimeZoneNamed" }) {} /** * @category api interface @@ -5931,11 +5904,7 @@ export class TimeZone extends transformOrFail( }), encode: (tz) => ParseResult.succeed(dateTime.zoneToString(tz)) } -).annotations({ identifier: "TimeZone" }) { - static override annotations: ( - annotations: Annotations.Schema - ) => typeof TimeZone = super.annotations -} +).annotations({ identifier: "TimeZone" }) {} const timeZoneArbitrary: LazyArbitrary = (fc) => fc.oneof( @@ -5959,11 +5928,7 @@ export class DateTimeZonedFromSelf extends declare( fc.date().chain((date) => timeZoneArbitrary(fc).map((timeZone) => dateTime.unsafeMakeZoned(date, { timeZone }))), equivalence: () => dateTime.Equivalence } -) { - static override annotations: ( - annotations: Annotations.Schema - ) => typeof DateTimeZonedFromSelf = super.annotations -} +) {} /** * Defines a schema that attempts to convert a `string` to a `DateTime.Zoned` instance. @@ -5983,11 +5948,7 @@ export class DateTimeZoned extends transformOrFail( }), encode: (dt) => ParseResult.succeed(dateTime.zonedToString(dt)) } -).annotations({ identifier: "DateTime.Zoned" }) { - static override annotations: ( - annotations: Annotations.Schema - ) => typeof DateTimeZoned = super.annotations -} +).annotations({ identifier: "DateTime.Zoned" }) {} /** * @category Option utils