We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 013171f commit 9fa9e68Copy full SHA for 9fa9e68
packages/cma-client/src/idUtils.ts
@@ -34,6 +34,13 @@ function fromUrlSafeBase64toUint8Array(urlSafeBase64: string): Uint8Array {
34
}
35
36
export function isValidId(id: string) {
37
+ // For backward compatibility, first check to see if this is an older-style integer ID formerly used by Dato
38
+ if (/^\d+$/.test(id)) {
39
+ const intId = BigInt(id);
40
+ const maxDatoIntegerId = 281474976710655; // Max 6-byte/48-bit unsigned int
41
+ return intId <= maxDatoIntegerId;
42
+ }
43
+
44
const bytes = fromUrlSafeBase64toUint8Array(id);
45
46
// UUIDs are 16 bytes
0 commit comments