@4players/odin-common
Version:
A collection of commonly used type definitions and utility functions across ODIN web projects
39 lines (38 loc) • 983 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isProperty = isProperty;
exports.isFunction = isFunction;
exports.isNull = isNull;
exports.isNumber = isNumber;
exports.isObject = isObject;
exports.isString = isString;
exports.isUndefined = isUndefined;
exports.isFailure = isFailure;
exports.isSuccess = isSuccess;
function isProperty(object, name) {
return name in object;
}
function isFunction(value) {
return typeof value === 'function';
}
function isNull(value) {
return typeof value === 'object' && value === null;
}
function isNumber(value) {
return typeof value === 'number';
}
function isObject(value) {
return typeof value === 'object';
}
function isString(value) {
return typeof value === 'string';
}
function isUndefined(value) {
return typeof value === 'undefined';
}
function isFailure(result) {
return result.type === 'Failure';
}
function isSuccess(result) {
return result.type === 'Success';
}