UNPKG

@kitmi/utils

Version:

A JavaScript utility library for both server and browser

15 lines (12 loc) 294 B
/** * Check whether the object is an ES module, if yes, return the default export. * @param {*} obj * @returns {*} */ const esmCheck = (obj) => { if (obj.__esModule && typeof obj.default !== 'undefined') { return obj.default; } return obj; }; export default esmCheck;