ciam-commons
Advanced tools
Comparing version 1.4.1 to 1.5.0
@@ -14,2 +14,3 @@ export declare namespace Check { | ||
function inRange(n: number, min: number, max: number, name: string): void; | ||
function oneOf<T>(obj: T, options: Array<T>, name: string): void; | ||
} | ||
@@ -16,0 +17,0 @@ export declare namespace Model { |
@@ -47,2 +47,7 @@ export var Check; | ||
Check.inRange = inRange; | ||
function oneOf(obj, options, name) { | ||
if (!options.includes(obj)) | ||
throw new Error(`${name} must be one of ${options.toString()}`); | ||
} | ||
Check.oneOf = oneOf; | ||
})(Check || (Check = {})); | ||
@@ -49,0 +54,0 @@ export var Model; |
{ | ||
"name": "ciam-commons", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"description": "Common types and functions for CIAM", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -41,2 +41,6 @@ export namespace Check { | ||
export function oneOf<T>(obj: T, options: Array<T>, name: string) { | ||
if (!options.includes(obj)) throw new Error(`${name} must be one of ${options.toString()}`); | ||
} | ||
} | ||
@@ -43,0 +47,0 @@ |
11031
264