vscode-jsonrpc
Version:
A json rpc implementation over streams
47 lines • 1.5 kB
JavaScript
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
;
var toString = Object.prototype.toString;
function defined(value) {
return typeof value !== 'undefined';
}
exports.defined = defined;
function undefined(value) {
return typeof value === 'undefined';
}
exports.undefined = undefined;
function nil(value) {
return value === null;
}
exports.nil = nil;
function boolean(value) {
return value === true || value === false;
}
exports.boolean = boolean;
function string(value) {
return toString.call(value) === '[object String]';
}
exports.string = string;
function number(value) {
return toString.call(value) === '[object Number]';
}
exports.number = number;
function error(value) {
return toString.call(value) === '[object Error]';
}
exports.error = error;
function func(value) {
return toString.call(value) === '[object Function]';
}
exports.func = func;
function array(value) {
return Array.isArray(value);
}
exports.array = array;
function stringArray(value) {
return array(value) && value.every(function (elem) { return string(elem); });
}
exports.stringArray = stringArray;
//# sourceMappingURL=is.js.map