iep-ui
Version:
An enterprise-class UI design language and Vue-based implementation
39 lines (31 loc) • 1.15 kB
JavaScript
import _typeof from 'babel-runtime/helpers/typeof';
import Vue from 'vue';
export function isString(obj) {
return Object.prototype.toString.call(obj) === '[object String]';
}
export function isObject(obj) {
return Object.prototype.toString.call(obj) === '[object Object]';
}
export function isHtmlElement(node) {
return node && node.nodeType === Node.ELEMENT_NODE;
}
/**
* - Inspired:
* https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
*/
var isFunction = function isFunction(functionToCheck) {
var getType = {};
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
};
if (typeof /./ !== 'function' && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (Vue.prototype.$isServer || typeof document.childNodes !== 'function')) {
isFunction = function isFunction(obj) {
return typeof obj === 'function' || false;
};
}
export { isFunction };
export var isUndefined = function isUndefined(val) {
return val === void 0;
};
export var isDefined = function isDefined(val) {
return val !== undefined && val !== null;
};