2 /* --------------------------------------------------------------------------------------------
3 * Copyright (c) Microsoft Corporation. All rights reserved.
4 * Licensed under the MIT License. See License.txt in the project root for license information.
5 * ------------------------------------------------------------------------------------------ */
6 Object.defineProperty(exports, "__esModule", { value: true });
7 exports.thenable = exports.typedArray = exports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;
8 function boolean(value) {
9 return value === true || value === false;
11 exports.boolean = boolean;
12 function string(value) {
13 return typeof value === 'string' || value instanceof String;
15 exports.string = string;
16 function number(value) {
17 return typeof value === 'number' || value instanceof Number;
19 exports.number = number;
20 function error(value) {
21 return value instanceof Error;
23 exports.error = error;
24 function func(value) {
25 return typeof value === 'function';
28 function array(value) {
29 return Array.isArray(value);
31 exports.array = array;
32 function stringArray(value) {
33 return array(value) && value.every(elem => string(elem));
35 exports.stringArray = stringArray;
36 function typedArray(value, check) {
37 return Array.isArray(value) && value.every(check);
39 exports.typedArray = typedArray;
40 function thenable(value) {
41 return value && func(value.then);
43 exports.thenable = thenable;
44 //# sourceMappingURL=is.js.map