massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-json / node_modules / vscode-languageserver / lib / common / utils / is.js
1 "use strict";
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;
10 }
11 exports.boolean = boolean;
12 function string(value) {
13     return typeof value === 'string' || value instanceof String;
14 }
15 exports.string = string;
16 function number(value) {
17     return typeof value === 'number' || value instanceof Number;
18 }
19 exports.number = number;
20 function error(value) {
21     return value instanceof Error;
22 }
23 exports.error = error;
24 function func(value) {
25     return typeof value === 'function';
26 }
27 exports.func = func;
28 function array(value) {
29     return Array.isArray(value);
30 }
31 exports.array = array;
32 function stringArray(value) {
33     return array(value) && value.every(elem => string(elem));
34 }
35 exports.stringArray = stringArray;
36 function typedArray(value, check) {
37     return Array.isArray(value) && value.every(check);
38 }
39 exports.typedArray = typedArray;
40 function thenable(value) {
41     return value && func(value.then);
42 }
43 exports.thenable = thenable;
44 //# sourceMappingURL=is.js.map