UNPKG

funtool

Version:

A modern, efficient, and modular JavaScript utility library designed to enhance developer productivity.

3 lines (2 loc) 2.14 kB
"use strict";function t(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function e(t){if(!function(t){return"function"==typeof t||"object"==typeof t&&null!==t}(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype||null===Object.getPrototypeOf(e)}function r(t){return"function"==typeof t}function n(t){return"object"!=typeof t&&"function"!=typeof t||null==t}function o(t,e){if(n(t))return[];return("undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys(t):[...Object.getOwnPropertyNames?Object.getOwnPropertyNames(t):[],...Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]]).filter((n=>{const o=Object.getOwnPropertyDescriptor(t,n);return!!o&&(r(e)?e(n,o):o.enumerable)}))}exports.hasOwn=function(t,e){return!n(t)&&Object.prototype.hasOwnProperty.call(t,e)},exports.keys=o,exports.merge=function(t,e){const r={...t};return o(e).forEach((t=>{const n=Object.getOwnPropertyDescriptor(e,t);n&&Object.defineProperty(r,t,n)})),r},exports.mergeDeep=function r(c,f){if(t(c)&&t(f)){const t=Math.max(c.length,f.length),e=[];for(let o=0;o<t;o++){const t=c[o],u=f[o];n(t)||n(u)?e[o]=void 0!==u?u:t:e[o]=r(t,u)}return e}if(e(c)&&e(f)){const t={...c};return o(f).forEach((e=>{const o=c[e],u=f[e];n(o)||n(u)?t[e]=u:t[e]=r(o,u)})),t}return f},exports.omit=function(t,e){const r={};return o(t).forEach((n=>{e.includes(n)||(r[n]=t[n])})),r},exports.omitBy=function(t,e){const r={};return o(t).forEach((n=>{e(t[n],n)||(r[n]=t[n])})),r},exports.pick=function(t,e){const r={};for(const n of e)n in t&&(r[n]=t[n]);return r},exports.pickBy=function(t,e){const r={};for(const n in t)e(t[n],n)&&(r[n]=t[n]);return r},exports.values=function(t,e){return n(t)?[]:("undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys(t):[...Object.getOwnPropertyNames?Object.getOwnPropertyNames(t):[],...Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]]).filter((n=>{const o=Object.getOwnPropertyDescriptor(t,n);return!!o&&(r(e)?e(n,o):o.enumerable)})).map((e=>t[e]))}; //# sourceMappingURL=index.cjs.js.map