* Extracts the shard ID from an Evernote developer token. * Token format: "S=s1:U=12345:..." where s1 is the shard.
(token: string)
| 23 | * Token format: "S=s1:U=12345:..." where s1 is the shard. |
| 24 | */ |
| 25 | function extractShardId(token: string): string { |
| 26 | const match = token.match(/S=s(\d+)/) |
| 27 | if (!match) { |
| 28 | throw new Error('Invalid Evernote token format: cannot extract shard ID') |
| 29 | } |
| 30 | return `s${match[1]}` |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Extracts the user ID from an Evernote developer token. |
no outgoing calls
no test coverage detected