diff --git a/src/node/node.js b/src/node/node.js index 3d2a0ec..6dfd5b5 100644 --- a/src/node/node.js +++ b/src/node/node.js @@ -93,10 +93,11 @@ export function toGlobalId(type: string, id: string): string { * used to create it. */ export function fromGlobalId(globalId: string): ResolvedGlobalId { - var tokens = unbase64(globalId).split(':', 2); + var unbasedGlobalId = unbase64(globalId); + var delimiterPos = unbasedGlobalId.indexOf(':'); return { - type: tokens[0], - id: tokens[1] + type: unbasedGlobalId.substring(0, delimiterPos), + id: unbasedGlobalId.substring(delimiterPos + 1) }; }