Download packages/app/src/pages/session/message-id-from-hash.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 200 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/src/pages/session/message-id-from-hash.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/app/src/pages/session/message-id-from-hash.ts
-
curl -L -o message-id-from-hash.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/src/pages/session/message-id-from-hash.ts
200 Bytes
| export const messageIdFromHash = (hash: string) => { | |
| const value = hash.startsWith("#") ? hash.slice(1) : hash | |
| const match = value.match(/^message-(.+)$/) | |
| if (!match) return | |
| return match[1] | |
| } | |