UNPKG

funtool

Version:

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

3 lines (2 loc) 2.12 kB
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 n(t){return"function"==typeof t}function r(t){return"object"!=typeof t&&"function"!=typeof t||null==t}function o(t,e){return!r(t)&&Object.prototype.hasOwnProperty.call(t,e)}function c(t,e){if(r(t))return[];return("undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys(t):[...Object.getOwnPropertyNames?Object.getOwnPropertyNames(t):[],...Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]]).filter((r=>{const o=Object.getOwnPropertyDescriptor(t,r);return!!o&&(n(e)?e(r,o):o.enumerable)}))}function f(t,e){const n={...t};return c(e).forEach((t=>{const r=Object.getOwnPropertyDescriptor(e,t);r&&Object.defineProperty(n,t,r)})),n}function u(n,o){if(t(n)&&t(o)){const t=Math.max(n.length,o.length),e=[];for(let c=0;c<t;c++){const t=n[c],f=o[c];r(t)||r(f)?e[c]=void 0!==f?f:t:e[c]=u(t,f)}return e}if(e(n)&&e(o)){const t={...n};return c(o).forEach((e=>{const c=n[e],f=o[e];r(c)||r(f)?t[e]=f:t[e]=u(c,f)})),t}return o}function y(t,e){const n={};return c(t).forEach((r=>{e.includes(r)||(n[r]=t[r])})),n}function i(t,e){const n={};return c(t).forEach((r=>{e(t[r],r)||(n[r]=t[r])})),n}function p(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function s(t,e){const n={};for(const r in t)e(t[r],r)&&(n[r]=t[r]);return n}function O(t,e){if(r(t))return[];return("undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys(t):[...Object.getOwnPropertyNames?Object.getOwnPropertyNames(t):[],...Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]]).filter((r=>{const o=Object.getOwnPropertyDescriptor(t,r);return!!o&&(n(e)?e(r,o):o.enumerable)})).map((e=>t[e]))}export{o as hasOwn,c as keys,f as merge,u as mergeDeep,y as omit,i as omitBy,p as pick,s as pickBy,O as values}; //# sourceMappingURL=index.esm.js.map