mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 18:12:09 +08:00
12 lines
325 B
TypeScript
12 lines
325 B
TypeScript
export function checkKey(key: string): void {
|
|
if (typeof key !== 'string') {
|
|
throw new Error("key: '" + key + "' must be a string");
|
|
}
|
|
}
|
|
|
|
export function ensureValidValue(value: any, valueType: string): void {
|
|
if (typeof value !== valueType) {
|
|
throw new Error("value: '" + value + "' must be a " + valueType);
|
|
}
|
|
}
|