From 7b431143a72c3a35b2ed2f3719f12413a7257acc Mon Sep 17 00:00:00 2001 From: Lukas Heizmann <49527534+lkwr@users.noreply.github.com> Date: Sun, 8 Dec 2024 14:24:24 +0100 Subject: [PATCH] Use explicit type for default replacer --- src/data/cbor.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/data/cbor.ts b/src/data/cbor.ts index ebf449e..de01aa4 100644 --- a/src/data/cbor.ts +++ b/src/data/cbor.ts @@ -1,4 +1,4 @@ -import { Tagged, decode, encode } from "../cbor"; +import { Tagged, decode, encode, type Replacer } from "../cbor"; import { cborCustomDateToDate, dateToCborCustomDate, @@ -55,7 +55,10 @@ const TAG_GEOMETRY_MULTILINE = 92; const TAG_GEOMETRY_MULTIPOLYGON = 93; const TAG_GEOMETRY_COLLECTION = 94; -export const replacer = { +export const replacer: { + encode: Replacer; + decode: Replacer; +} = { encode(v: unknown): unknown { if (v instanceof Date) { return new Tagged(TAG_CUSTOM_DATETIME, dateToCborCustomDate(v));