ll-package
Version:
2 lines (1 loc) • 1.45 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=t=>typeof t=="function",l=Array.isArray,p=t=>typeof t=="string",f=t=>t!==null&&typeof t=="object",h=/^on[^a-z]/,d=t=>h.test(t),s=t=>{const n=Object.create(null);return e=>n[e]||(n[e]=t(e))},g=/-(\w)/g,y=s(t=>t.replace(g,(n,e)=>e?e.toUpperCase():"")),m=/\B([A-Z])/g,P=s(t=>t.replace(m,"-$1").toLowerCase()),O=s(t=>t.charAt(0).toUpperCase()+t.slice(1)),A=Object.prototype.hasOwnProperty,a=(t,n)=>A.call(t,n);function b(t,n,e,r){const o=t[e];if(o!=null){const i=a(o,"default");if(i&&r===void 0){const c=o.default;r=o.type!==Function&&u(c)?c():c}o.type===Boolean&&(!a(n,e)&&!i?r=!1:r===""&&(r=!0))}return r}function w(t){return Object.keys(t).reduce((n,e)=>((e.startsWith("data-")||e.startsWith("aria-"))&&(n[e]=t[e]),n),{})}function F(t){return typeof t=="number"?`${t}px`:t}function j(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2?arguments[2]:void 0;return typeof t=="function"?t(n):t??e}function z(t){let n;const e=new Promise(o=>{n=t(()=>{o(!0)})}),r=()=>{n==null||n()};return r.then=(o,i)=>e.then(o,i),r.promise=e,r}exports.cacheStringFunction=s;exports.camelize=y;exports.capitalize=O;exports.getDataAndAriaProps=w;exports.hyphenate=P;exports.isArray=l;exports.isFunction=u;exports.isObject=f;exports.isOn=d;exports.isString=p;exports.renderHelper=j;exports.resolvePropValue=b;exports.toPx=F;exports.wrapPromiseFn=z;
;