"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isNumber = exports.isString = exports.isDefined = exports.isNonEmptyArray = exports.isObject = void 0;
const isObject = (candidate) => {
    return candidate !== null && candidate !== undefined && typeof candidate === 'object';
};
exports.isObject = isObject;
const isNonEmptyArray = (candidate) => {
    return Array.isArray(candidate) && candidate.length > 0;
};
exports.isNonEmptyArray = isNonEmptyArray;
const isDefined = (value) => value !== undefined && value !== null;
exports.isDefined = isDefined;
const isString = (candidate) => {
    if (candidate === undefined || candidate === null) {
        return undefined;
    }
    if (typeof candidate === 'string')
        return candidate;
    throw new Error('parameter is not string');
};
exports.isString = isString;
const isNumber = (candidate) => {
    if (candidate === undefined || candidate === null) {
        return undefined;
    }
    if (typeof candidate === 'number')
        return candidate;
    throw new Error('parameter is not number');
};
exports.isNumber = isNumber;
//# sourceMappingURL=predicates.js.map