@copilotkit/shared
Version:
<div align="center"> <a href="https://copilotkit.ai" target="_blank"> <img src="https://github.com/copilotkit/copilotkit/raw/main/assets/banner.png" alt="CopilotKit Logo"> </a>
1 lines • 994 B
Source Map (JSON)
{"version":3,"sources":["../src/utils/random-id.ts"],"sourcesContent":["import { v4 as uuidv4, validate, v5 as uuidv5 } from \"uuid\";\n\nexport function randomId() {\n return \"ck-\" + uuidv4();\n}\n\nexport function randomUUID() {\n return uuidv4();\n}\n\nexport function dataToUUID(input: string, namespace?: string): string {\n const BASE_NAMESPACE = \"e4b01160-ff74-4c6e-9b27-d53cd930fe8e\";\n // Since namespace needs to be a uuid, we are creating a uuid for it.\n const boundNamespace = namespace ? uuidv5(namespace, BASE_NAMESPACE) : BASE_NAMESPACE;\n return uuidv5(input, boundNamespace);\n}\n\nexport function isValidUUID(uuid: string) {\n return validate(uuid);\n}\n"],"mappings":";AAAA,SAAS,MAAM,QAAQ,UAAU,MAAM,cAAc;AAE9C,SAAS,WAAW;AACzB,SAAO,QAAQ,OAAO;AACxB;AAEO,SAAS,aAAa;AAC3B,SAAO,OAAO;AAChB;AAEO,SAAS,WAAW,OAAe,WAA4B;AACpE,QAAM,iBAAiB;AAEvB,QAAM,iBAAiB,YAAY,OAAO,WAAW,cAAc,IAAI;AACvE,SAAO,OAAO,OAAO,cAAc;AACrC;AAEO,SAAS,YAAY,MAAc;AACxC,SAAO,SAAS,IAAI;AACtB;","names":[]}