(store: string, key: string)
| 47 | } |
| 48 | |
| 49 | function getEntryPath(store: string, key: string): string { |
| 50 | // PR-0a fix: validateKey rejects any '/' or '\' (and other unsafe chars) |
| 51 | // up front, so the previous .replace(/[/\\]/g, '_') sanitize is no longer |
| 52 | // needed and was actually harmful: it caused 'a/b' and 'a_b' to collide |
| 53 | // on the same a_b.md file. Backward compat: pre-existing a_b.md files |
| 54 | // (regardless of the original key the user typed) remain readable as |
| 55 | // key='a_b' under the new validator. |
| 56 | validateKey(key) |
| 57 | return join(getStoreDir(store), `${key}.md`) |
| 58 | } |
| 59 | |
| 60 | /** Maximum allowed store name length (OS path component limit). */ |
| 61 | const MAX_STORE_NAME_LENGTH = 255 |
no test coverage detected