(name: string)
| 36 | |
| 37 | /** Validate a local repo name and return it, or throw. */ |
| 38 | export function assertLocalName(name: string): string { |
| 39 | if (name.length === 0) { |
| 40 | throw new InvalidRepoNameError(name, "must not be empty"); |
| 41 | } |
| 42 | if (!VALID_REPO_NAME.test(name)) { |
| 43 | throw new InvalidRepoNameError(name, VALID_REPO_NAME_DESCRIPTION); |
| 44 | } |
| 45 | if (name.includes(SCOPE_SEPARATOR)) { |
| 46 | throw new InvalidRepoNameError(name, `must not contain '${SCOPE_SEPARATOR}'`); |
| 47 | } |
| 48 | return name; |
| 49 | } |
| 50 | |
| 51 | /** Build the fully-qualified name the binding stores. */ |
| 52 | export function scopedName(sessionId: string, name: string): string { |
no outgoing calls
no test coverage detected