ngx-bootstrap
Version:
Native Angular Bootstrap Components
30 lines • 1.05 kB
JavaScript
import { absFloor } from '../utils';
export function isDateValid(date) {
return date && !isNaN(date.getTime());
}
export function isFunction(fn) {
return fn instanceof Function || Object.prototype.toString.call(fn) === '[object Function]';
}
export function isArray(input) {
return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
}
export function hasOwnProp(a /*object*/, b) {
return Object.prototype.hasOwnProperty.call(a, b);
}
export function isObject(input /*object*/) {
// IE8 will treat undefined and null as object if it wasn't for
// input != null
return input != null && Object.prototype.toString.call(input) === '[object Object]';
}
export function isUndefined(input) {
return input === void 0;
}
export function toInt(argumentForCoercion) {
var coercedNumber = +argumentForCoercion;
var value = 0;
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
value = absFloor(coercedNumber);
}
return value;
}
//# sourceMappingURL=type-checks.js.map