You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
742 B
TypeScript

import { ProblemId, SolutionId, UserId } from './model'
// export function refToUserId(ref: string): UserId {
// if (!ref.startsWith('user/')) {
// throw new Error(`"${ref}" is not a reference to a User`)
// }
// return ref.slice('user/'.length)
// }
// export function refToProblemId(ref: string): ProblemId {
// if (!ref.startsWith('problem/')) {
// throw new Error(`"${ref}" is not a reference to a Problem`)
// }
// return ref.slice('problem/'.length)
// }
// export function refToSolutionId(ref: string): SolutionId {
// if (!ref.startsWith('solution/')) {
// throw new Error(`"${ref}" is not a reference to a Solution`)
// }
// return ref.slice('solution/'.length)
// }