Rebasely Beta: data may be purged

justintypescript-ultra-strict Public

Text · 15 lines · 485 B · at 9dcde16

import { type Option, type Result } from "@tsus/runtime";export type QueryError =  | { kind: "malformed"; param: string }  | { kind: "missing" }  | { kind: "not_integer"; raw: string }  | { kind: "out_of_range"; value: number };export const getParam = (query: string, name: string): Result<Option<string>, QueryError> => {  // TODO};export const getIntParam = (query: string, name: string, range: { min: number; max: number }): Result<number, QueryError> => {  // TODO};