nsarrazin commited on
Commit
d1d09f6
·
1 Parent(s): 5b7c1e9

fix: tools

Browse files
Files changed (1) hide show
  1. src/lib/APIClient.ts +1 -1
src/lib/APIClient.ts CHANGED
@@ -8,7 +8,7 @@ import ObjectId from "bson-objectid";
8
  superjson.registerCustom<ObjectId, string>(
9
  {
10
  isApplicable: (value): value is ObjectId => {
11
- if (ObjectId.isValid(value)) {
12
  const str = value.toString();
13
  return /^[0-9a-fA-F]{24}$/.test(str);
14
  }
 
8
  superjson.registerCustom<ObjectId, string>(
9
  {
10
  isApplicable: (value): value is ObjectId => {
11
+ if (typeof value !== "string" && ObjectId.isValid(value)) {
12
  const str = value.toString();
13
  return /^[0-9a-fA-F]{24}$/.test(str);
14
  }