95e8fa741fc56f62bb546ab4476526508ca921a70424f7b9b4934828bbf2d6efa26139e4c6c5c1fbe8cddff0816982d0bb422f7accd3215b75d586e0838841 986 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import Vue from 'vue';
  2. export function isString(obj) {
  3. return Object.prototype.toString.call(obj) === '[object String]';
  4. }
  5. export function isObject(obj) {
  6. return Object.prototype.toString.call(obj) === '[object Object]';
  7. }
  8. export function isHtmlElement(node) {
  9. return node && node.nodeType === Node.ELEMENT_NODE;
  10. }
  11. /**
  12. * - Inspired:
  13. * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
  14. */
  15. let isFunction = (functionToCheck) => {
  16. var getType = {};
  17. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  18. };
  19. if (typeof /./ !== 'function' && typeof Int8Array !== 'object' && (Vue.prototype.$isServer || typeof document.childNodes !== 'function')) {
  20. isFunction = function(obj) {
  21. return typeof obj === 'function' || false;
  22. };
  23. }
  24. export {
  25. isFunction
  26. };
  27. export const isUndefined = (val)=> {
  28. return val === void 0;
  29. };
  30. export const isDefined = (val) => {
  31. return val !== undefined && val !== null;
  32. };