import * as check from "../../../../generated/sync/check/dictionary-of/number"; import {AssertError} from "../../../../sync/error/AssertError"; export function assertDictionaryOfPotentiallyUnsafeNumber (name : string, mixed : any) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfPotentiallyUnsafeNumber(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } } export function assertDictionaryOfFiniteNumber (name : string, mixed : any) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfFiniteNumber(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } } export function assertDictionaryOfInteger (name : string, mixed : any) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfInteger(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } } export function assertDictionaryOfGreaterThan (name : string, mixed : any, x : number) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfGreaterThan(mixed, x); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed, x); } } export function assertDictionaryOfGreaterThanHandler (x : number) : (name : string, mixed : any) => ({ [key : string] : number })|never { return (name : string, mixed : any) : ({ [key : string] : number })|never => { return assertDictionaryOfGreaterThan(name, mixed, x); }; } export function assertDictionaryOfGreaterThanOrEqual (name : string, mixed : any, x : number) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfGreaterThanOrEqual(mixed, x); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed, x); } } export function assertDictionaryOfGreaterThanOrEqualHandler (x : number) : (name : string, mixed : any) => ({ [key : string] : number })|never { return (name : string, mixed : any) : ({ [key : string] : number })|never => { return assertDictionaryOfGreaterThanOrEqual(name, mixed, x); }; } export function assertDictionaryOfLessThan (name : string, mixed : any, x : number) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfLessThan(mixed, x); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed, x); } } export function assertDictionaryOfLessThanHandler (x : number) : (name : string, mixed : any) => ({ [key : string] : number })|never { return (name : string, mixed : any) : ({ [key : string] : number })|never => { return assertDictionaryOfLessThan(name, mixed, x); }; } export function assertDictionaryOfLessThanOrEqual (name : string, mixed : any, x : number) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfLessThanOrEqual(mixed, x); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed, x); } } export function assertDictionaryOfLessThanOrEqualHandler (x : number) : (name : string, mixed : any) => ({ [key : string] : number })|never { return (name : string, mixed : any) : ({ [key : string] : number })|never => { return assertDictionaryOfLessThanOrEqual(name, mixed, x); }; } export function assertDictionaryOfRange (name : string, mixed : any, args : { min? : number, max? : number }) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfRange(mixed, args); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed, args); } } export function assertDictionaryOfRangeHandler (args : { min? : number, max? : number }) : (name : string, mixed : any) => ({ [key : string] : number })|never { return (name : string, mixed : any) : ({ [key : string] : number })|never => { return assertDictionaryOfRange(name, mixed, args); }; } export function assertDictionaryOfPositive (name : string, mixed : any) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfPositive(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } } export function assertDictionaryOfNegative (name : string, mixed : any) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfNegative(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } } export function assertDictionaryOfNonNegative (name : string, mixed : any) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfNonNegative(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } } export function assertDictionaryOfNaturalNumber (name : string, mixed : any) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfNaturalNumber(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } } export function assertDictionaryOfOdd (name : string, mixed : any) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfOdd(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } } export function assertDictionaryOfEven (name : string, mixed : any) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfEven(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } } export function assertDictionaryOfNotOneOf (name : string, mixed : any, arr : T[]) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfNotOneOf(mixed, arr); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed, arr); } } export function assertDictionaryOfNotOneOfHandler (arr : T[]) : (name : string, mixed : any) => ({ [key : string] : number })|never { return (name : string, mixed : any) : ({ [key : string] : number })|never => { return assertDictionaryOfNotOneOf(name, mixed, arr); }; } export function assertDictionaryOfLatitude (name : string, mixed : any) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfLatitude(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } } export function assertDictionaryOfLongitude (name : string, mixed : any) : ({ [key : string] : number })|never { const error = check.checkDictionaryOfLongitude(mixed); if (error === undefined) { return mixed; } else { throw new AssertError(name, error, mixed); } }