Skip to content

Commit

Permalink
Use explicit type for default replacer
Browse files Browse the repository at this point in the history
  • Loading branch information
lkwr committed Dec 8, 2024
1 parent 80c1847 commit 7b43114
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/data/cbor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tagged, decode, encode } from "../cbor";
import { Tagged, decode, encode, type Replacer } from "../cbor";
import {
cborCustomDateToDate,
dateToCborCustomDate,
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 7b43114

Please sign in to comment.