2020-12-20 01:43:36 +02:00
|
|
|
function isString(value) {
|
2020-10-05 21:29:39 +03:00
|
|
|
return typeof value === 'string';
|
2020-12-20 01:43:36 +02:00
|
|
|
}
|
2020-10-05 21:29:39 +03:00
|
|
|
|
2020-12-20 01:43:36 +02:00
|
|
|
function isNumber(value) {
|
2020-10-05 21:29:39 +03:00
|
|
|
return typeof value === 'number';
|
2020-12-20 01:43:36 +02:00
|
|
|
}
|
2020-10-05 21:29:39 +03:00
|
|
|
|
2020-12-20 01:43:36 +02:00
|
|
|
function isBoolean(value) {
|
2020-10-05 21:29:39 +03:00
|
|
|
return typeof value === 'boolean';
|
2020-12-20 01:43:36 +02:00
|
|
|
}
|
2020-10-05 21:29:39 +03:00
|
|
|
|
2020-12-20 01:43:36 +02:00
|
|
|
function isUndefined(value) {
|
2020-10-05 21:29:39 +03:00
|
|
|
return typeof value === 'undefined';
|
2020-12-20 01:43:36 +02:00
|
|
|
}
|
2020-10-05 21:29:39 +03:00
|
|
|
|
2020-12-20 01:43:36 +02:00
|
|
|
function isObject(value) {
|
2020-10-05 21:29:39 +03:00
|
|
|
return typeof value === 'object' && value !== null;
|
2020-12-20 01:43:36 +02:00
|
|
|
}
|
2020-10-05 21:29:39 +03:00
|
|
|
|
2020-12-20 01:43:36 +02:00
|
|
|
function isFunction(value) {
|
2020-10-05 21:29:39 +03:00
|
|
|
return typeof value === 'function';
|
2020-12-20 01:43:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
isString,
|
|
|
|
isNumber,
|
|
|
|
isBoolean,
|
|
|
|
isUndefined,
|
|
|
|
isObject,
|
|
|
|
isFunction,
|
2020-10-05 21:29:39 +03:00
|
|
|
};
|