typeshi 1.7.8 → 1.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -156,6 +156,8 @@ export declare class isOptional {
|
|
|
156
156
|
static number: (value: any, requireInteger?: boolean, requireNonNegative?: boolean) => value is number | undefined | null;
|
|
157
157
|
static positiveInteger: (value: any) => value is number | undefined | null;
|
|
158
158
|
static integerArray: (value: any, requireNonNegative?: boolean) => value is number[] | undefined | null;
|
|
159
|
+
static boolean: (value: any) => value is boolean | undefined | null;
|
|
160
|
+
static function: (value: any) => value is Function | undefined | null;
|
|
159
161
|
}
|
|
160
162
|
export declare class isUndefinedOr {
|
|
161
163
|
static type: <T>(value: any, guard: (v: any, ...args: any[]) => v is T, ...args: any[]) => value is T | undefined;
|
|
@@ -170,6 +172,8 @@ export declare class isUndefinedOr {
|
|
|
170
172
|
static number: (value: any, requireInteger?: boolean, requireNonNegative?: boolean) => value is number | undefined;
|
|
171
173
|
static positiveInteger: (value: any) => value is number | undefined;
|
|
172
174
|
static integerArray: (value: any, requireNonNegative?: boolean) => value is number[] | undefined;
|
|
175
|
+
static boolean: (value: any) => value is boolean | undefined;
|
|
176
|
+
static function: (value: any) => value is Function | undefined;
|
|
173
177
|
}
|
|
174
178
|
/**
|
|
175
179
|
* these may be unnecessary, but added for completeness
|
|
@@ -327,6 +327,12 @@ isOptional.positiveInteger = (value) => {
|
|
|
327
327
|
isOptional.integerArray = (value, requireNonNegative = false) => {
|
|
328
328
|
return isUndefinedOrNull(value) || isIntegerArray(value, requireNonNegative);
|
|
329
329
|
};
|
|
330
|
+
isOptional.boolean = (value) => {
|
|
331
|
+
return isUndefinedOrNull(value) || isBoolean(value);
|
|
332
|
+
};
|
|
333
|
+
isOptional.function = (value) => {
|
|
334
|
+
return isUndefinedOrNull(value) || isFunction(value);
|
|
335
|
+
};
|
|
330
336
|
class isUndefinedOr {
|
|
331
337
|
}
|
|
332
338
|
exports.isUndefinedOr = isUndefinedOr;
|
|
@@ -357,6 +363,12 @@ isUndefinedOr.positiveInteger = (value) => {
|
|
|
357
363
|
isUndefinedOr.integerArray = (value, requireNonNegative = false) => {
|
|
358
364
|
return isUndefined(value) || isIntegerArray(value, requireNonNegative);
|
|
359
365
|
};
|
|
366
|
+
isUndefinedOr.boolean = (value) => {
|
|
367
|
+
return isUndefined(value) || isBoolean(value);
|
|
368
|
+
};
|
|
369
|
+
isUndefinedOr.function = (value) => {
|
|
370
|
+
return isUndefined(value) || isFunction(value);
|
|
371
|
+
};
|
|
360
372
|
/**
|
|
361
373
|
* these may be unnecessary, but added for completeness
|
|
362
374
|
*/
|