File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import type {
88import {
99 isInstant ,
1010 instantFromEpochMilliseconds ,
11- instantToDate ,
1211} from "./temporal-types" ;
1312
1413export class SqliteConnection implements Queryable {
@@ -178,9 +177,9 @@ function decodeColumnValue<V = any>(
178177}
179178
180179function encodeColumnValue ( value : any ) : any {
181- // Handle Temporal.Instant - convert to ISO string
180+ // Handle Temporal.Instant - use built-in toString() for ISO string
182181 if ( isInstant ( value ) ) {
183- return instantToDate ( value ) . toISOString ( ) ;
182+ return value . toString ( ) ;
184183 }
185184 // Handle legacy Date objects
186185 if ( value instanceof Date ) {
Original file line number Diff line number Diff line change @@ -85,11 +85,7 @@ export function instantToEpochMilliseconds(instant: Instant): number {
8585 * @returns True if the value is a Temporal.Instant
8686 */
8787export function isInstant ( value : unknown ) : value is Instant {
88- return (
89- value !== null &&
90- typeof value === "object" &&
91- value instanceof Temporal . Instant
92- ) ;
88+ return value instanceof Temporal . Instant ;
9389}
9490
9591/**
@@ -98,9 +94,5 @@ export function isInstant(value: unknown): value is Instant {
9894 * @returns True if the value is a Temporal.Duration
9995 */
10096export function isDuration ( value : unknown ) : value is Duration {
101- return (
102- value !== null &&
103- typeof value === "object" &&
104- value instanceof Temporal . Duration
105- ) ;
97+ return value instanceof Temporal . Duration ;
10698}
You can’t perform that action at this time.
0 commit comments