UNPKG

friend-connect

Version:

**BEFORE YOU USE THIS TOOL, PLEASE READ THE FOLLOWING: WE _AS CONTRIBUTORS_ ARE NOT RESPONSIBLE FOR ANY DAMAGE OR LOSS CAUSED BY THIS APP. USE AN ALT ACCOUNT, JUST IN CASE THERE IS AN ISSUE WITH THIS METHOD.**

17 lines (16 loc) 515 B
// check if all the characters in the string are numbers const isNumber = (str) => { return /^\d+$/.test(str); }; export const parseIdentifier = (identifier) => { switch (typeof identifier) { case "number": return `xuid(${identifier})`; case "undefined": return "me"; case "string": if (isNumber(identifier) && identifier.length >= 16) return `xuid(${identifier})`; return `gt(${identifier})`; } };