From 1293d031027f78e0b9d28f2516810daa1c7d9ae3 Mon Sep 17 00:00:00 2001 From: Sawada Kenta Date: Thu, 30 Jan 2025 17:14:11 +0900 Subject: [PATCH] Properly separate global ID type when it includes colon --- src/node/node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/node.ts b/src/node/node.ts index cdec447..4d28807 100644 --- a/src/node/node.ts +++ b/src/node/node.ts @@ -98,7 +98,7 @@ export function toGlobalId(type: string, id: string | number): string { */ export function fromGlobalId(globalId: string): ResolvedGlobalId { const unbasedGlobalId = unbase64(globalId); - const delimiterPos = unbasedGlobalId.indexOf(':'); + const delimiterPos = unbasedGlobalId.lastIndexOf(':'); return { type: unbasedGlobalId.substring(0, delimiterPos), id: unbasedGlobalId.substring(delimiterPos + 1),