MCPcopy Index your code
hub / github.com/simstudioai/sim / extractUserId

Function extractUserId

apps/sim/connectors/evernote/evernote.ts:37–43  ·  view source on GitHub ↗

* Extracts the user ID from an Evernote developer token. * Token format: "S=s1:U=12345:..." where 12345 is the user ID.

(token: string)

Source from the content-addressed store, hash-verified

35 * Token format: "S=s1:U=12345:..." where 12345 is the user ID.
36 */
37function extractUserId(token: string): string {
38 const match = token.match(/:U=(\d+)/)
39 if (!match) {
40 throw new Error('Invalid Evernote token format: cannot extract user ID')
41 }
42 return match[1]
43}
44
45/**
46 * Returns the Evernote API host based on the token type.

Callers 1

evernote.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected