/**
 * common.js
 */

import {TYPE_FROM, TYPE_TO} from "./constant.js";

/* constants */
const TYPE_FROM = 8;
const TYPE_TO = -1;

/**
 * throw error
 * @param {!Object} e - Error
 * @throws
 */
export const throwErr = e => {
  throw e;
};

/**
 * get type
 * @param {*} o - object to check
 * @returns {string} - type of object
 */
export const getType = o =>
  Object.prototype.toString.call(o).slice(TYPE_FROM, TYPE_TO);

/**
 * is string
 * @param {*} o - object to check
 * @returns {boolean} - result
 */
export const isString = o => typeof o === "string" || o instanceof String;

/**
 * is object, and not an empty object
 * @param {*} o - object to check;
 * @returns {boolean} - result
 */
export const isObjectNotEmpty = o => {
  const items = /Object/i.test(getType(o)) && Object.keys(o);
  return !!(items && items.length);
};

@@ -19,59 +19,8 @@
 */%0A%0A
-import %7BTYPE_FROM, TYPE_TO%7D from %22./constant.js%22;%0A%0A
 /* c

Remove import