@estjs/shared 0.0.14 → 0.0.15-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/shared.cjs.js +3 -0
- package/dist/shared.cjs.js.map +1 -0
- package/dist/shared.d.cts +371 -43
- package/dist/shared.d.ts +371 -43
- package/dist/shared.dev.cjs.js +525 -0
- package/dist/shared.dev.cjs.js.map +1 -0
- package/dist/shared.dev.esm.js +431 -0
- package/dist/shared.dev.esm.js.map +1 -0
- package/dist/shared.esm.js +3 -0
- package/dist/shared.esm.js.map +1 -0
- package/package.json +22 -7
- package/dist/shared.cjs +0 -224
- package/dist/shared.cjs.map +0 -1
- package/dist/shared.js +0 -165
- package/dist/shared.js.map +0 -1
package/README.md
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';var d=e=>e!==null&&typeof e=="object";function A(e){return c.call(e)==="[object Promise]"}var p=Array.isArray;function i(e){return typeof e=="string"}function f(e){return typeof e=="number"}function y(e){return e===null}function E(e){return typeof e=="symbol"}function M(e){return c.call(e)==="[object Set]"}function N(e){return c.call(e)==="[object WeakMap]"}function C(e){return c.call(e)==="[object WeakSet]"}function L(e){return c.call(e)==="[object Map]"}function z(e){return e==null}var O=e=>typeof e=="function";function H(e){return e===false||e===null||e===void 0}var j=e=>["string","number","boolean","symbol","undefined"].includes(typeof e)||y(e);function R(e){return e instanceof HTMLElement}var P=e=>c.call(e)==="[object Object]";function _(e){return !i(e)||e===""?false:!Number.isNaN(Number(e))}function F(e){return typeof e=="undefined"}function B(e){return typeof e=="boolean"}function G(e){return Number.isNaN(e)}var c=Object.prototype.toString,U=Object.prototype.hasOwnProperty,$=Object.assign,h=(e,t)=>U.call(e,t);function q(e){return p(e)?e:[e]}var W=(e,t)=>!Object.is(e,t),D=Function.prototype;function I(e,t){return i(e)?e.indexOf(t)===0:false}function Y(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",n=e.length;for(let o=0;o<8;o++)t+=e.charAt(Math.floor(Math.random()*n));return t}function X(){return typeof window!="undefined"&&typeof document!="undefined"}var m=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},K=Object.freeze({}),J=Object.freeze([]),V=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90,k,Z=()=>k||(k=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var Q=/\B([A-Z])/g,g=m(e=>e.replaceAll(Q,"-$1").toLowerCase()),ee=/[_-](\w)/g,te=m(e=>(e=e.replaceAll(/^[_-]+|[_-]+$/g,""),e=e.replaceAll(/[_-]+/g,"-"),e.replaceAll(ee,(t,n)=>n.toUpperCase()))),ne=m(e=>e.charAt(0).toUpperCase()+e.slice(1));function oe(e,...t){console.warn(`[Essor warn]: ${e}`,...t);}function re(e,...t){console.info(`[Essor info]: ${e}`,...t);}function b(e,...t){console.error(`[Essor error]: ${e}`,...t);}var ie=/["&'<>]/;function se(e){let t=`${e}`,n=ie.exec(t);if(!n)return t;let o="",r,a,u=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}u!==a&&(o+=t.slice(u,a)),u=a+1,o+=r;}return u!==a?o+t.slice(u,a):o}var ae=/^-?>|<!--|-->|--!>|<!-$/g;function le(e){return e.replaceAll(ae,"")}var ce=/[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;function pe(e,t){return e.replaceAll(ce,n=>t?n==='"'?'\\\\\\"':`\\\\${n}`:`\\${n}`)}function s(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return n=>n in t}var T="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ue=s(T),me=s(`${T},async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);function de(e){return !!e||e===""}var fe=/[\t\n\f "'/=>]/,x={};function ge(e){if(h(x,e))return x[e];let t=fe.test(e);return t&&__DEV__&&b(`unsafe attribute name: ${e}`),x[e]=!t}var he={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},be=s("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap"),xe=s("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");function ye(e){if(e==null)return false;let t=typeof e;return t==="string"||t==="number"||t==="boolean"}var ke="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Te="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",we="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",Se="beforeinput,click,dblclick,contextmenu,focusin,focusout,input,keydown,keyup,mousedown,mousemove,mouseout,mouseover,mouseup,pointerdown,pointermove,pointerout,pointerover,pointerup,touchend,touchmove,touchstart",ve="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Ae="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Ee=s(ke),Me=s(Te),Ne=s(we),Ce=s(ve),Le=s(Ae),ze=s(Se);function Oe(e){return typeof HTMLInputElement!="undefined"&&e instanceof HTMLInputElement}function He(e){return typeof HTMLSelectElement!="undefined"&&e instanceof HTMLSelectElement}function je(e){return typeof HTMLTextAreaElement!="undefined"&&e instanceof HTMLTextAreaElement}function Re(e){return typeof HTMLFormElement!="undefined"&&e instanceof HTMLFormElement}function Pe(e){return typeof Text!="undefined"&&e instanceof Text}function _e(e){return typeof Node!="undefined"&&e instanceof Node}var Fe=/;(?![^(]*\))/g,Be=/:([\s\S]+)/,Ge=/\/\*[\s\S]*?\*\//g;function w(e){let t={};return e.replaceAll(Ge,"").split(Fe).forEach(n=>{if(n){let o=n.split(Be);o.length>1&&(t[o[0].trim()]=o[1].trim());}}),t}function S(e){if(p(e)){let t={};for(let n of e){let o=i(n)?w(n):S(n);if(o)for(let r in o)t[r]=o[r];}return t}if(i(e)||d(e))return e}function Ue(e){if(!e)return "";if(i(e))return e;let t="";for(let n in e){let o=e[n];if(i(o)||f(o)){let r=n.startsWith("--")?n:g(n);t+=`${r}:${o};`;}}return t}function v(e){if(e==null)return "";if(i(e))return e.trim();if(p(e))return e.map(v).filter(Boolean).join(" ");if(d(e)){let t=0;for(let r in e)e[r]&&t++;if(t===0)return "";let n=new Array(t),o=0;for(let r in e)e[r]&&(n[o++]=r);return n.join(" ")}return String(e).trim()}function $e(e){if(!e)return "";if(i(e))return e;let t="";for(let n in e){let o=e[n];if(i(o)||f(o)){let r=n.startsWith("--")?n:g(n);t+=`${r}:${o};`;}}return t}
|
|
2
|
+
exports.EMPTY_ARR=J;exports.EMPTY_OBJ=K;exports.cacheStringFunction=m;exports.camelCase=te;exports.capitalize=ne;exports.coerceArray=q;exports.error=b;exports.escapeHTML=se;exports.escapeHTMLComment=le;exports.extend=$;exports.generateUniqueId=Y;exports.getEscapedCssVarName=pe;exports.getGlobalThis=Z;exports.hasChanged=W;exports.hasOwn=h;exports.includeBooleanAttr=de;exports.info=re;exports.isArray=p;exports.isBoolean=B;exports.isBooleanAttr=me;exports.isBrowser=X;exports.isDelegatedEvent=ze;exports.isFalsy=H;exports.isFunction=O;exports.isHTMLElement=R;exports.isHTMLTag=Ee;exports.isHtmlFormElement=Re;exports.isHtmlInputElement=Oe;exports.isHtmlSelectElement=He;exports.isHtmlTextAreaElement=je;exports.isKnownHtmlAttr=be;exports.isKnownSvgAttr=xe;exports.isMap=L;exports.isMathMLTag=Ne;exports.isNaN=G;exports.isNil=z;exports.isNode=_e;exports.isNull=y;exports.isNumber=f;exports.isObject=d;exports.isOn=V;exports.isPlainObject=P;exports.isPrimitive=j;exports.isPromise=A;exports.isRenderAbleAttrValue=ye;exports.isSSRSafeAttrName=ge;exports.isSVGTag=Me;exports.isSelfClosingTag=Le;exports.isSet=M;exports.isSpecialBooleanAttr=ue;exports.isString=i;exports.isStringNumber=_;exports.isSymbol=E;exports.isTextNode=Pe;exports.isUndefined=F;exports.isVoidTag=Ce;exports.isWeakMap=N;exports.isWeakSet=C;exports.kebabCase=g;exports.noop=D;exports.normalizeClassName=v;exports.normalizeStyle=S;exports.parseStyleString=w;exports.propsToAttrMap=he;exports.startsWith=I;exports.styleObjectToString=$e;exports.styleToString=Ue;exports.warn=oe;//# sourceMappingURL=shared.cjs.js.map
|
|
3
|
+
//# sourceMappingURL=shared.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/is.ts","../src/base.ts","../src/string.ts","../src/logger.ts","../src/escape.ts","../src/dom.ts","../src/dom-types.ts","../src/normalize.ts"],"names":["isObject","val","isPromise","_toString","isArray","isString","isNumber","isNull","isSymbol","isSet","isWeakMap","isWeakSet","isMap","isNil","isFunction","isFalsy","isPrimitive","isHTMLElement","isPlainObject","isStringNumber","isUndefined","isBoolean","isNaN","hasOwnProperty","extend","hasOwn","key","coerceArray","data","hasChanged","value","oldValue","noop","startsWith","str","searchString","generateUniqueId","characters","result","charactersLength","i","isBrowser","cacheStringFunction","fn","cache","EMPTY_OBJ","EMPTY_ARR","isOn","_globalThis","getGlobalThis","hyphenateRE","kebabCase","camelizeRE","camelCase","_","c","capitalize","warn","msg","args","info","error","escapeRE","escapeHTML","string","match","html","escaped","index","lastIndex","commentStripRE","escapeHTMLComment","src","cssVarNameEscapeSymbolsRE","getEscapedCssVarName","doubleEscape","s","makeMap","map","specialBooleanAttrs","isSpecialBooleanAttr","isBooleanAttr","includeBooleanAttr","unsafeAttrCharRE","attrValidationCache","isSSRSafeAttrName","name","isUnsafe","propsToAttrMap","isKnownHtmlAttr","isKnownSvgAttr","isRenderAbleAttrValue","type","HTML_TAGS","SVG_TAGS","MATH_TAGS","DELEGATED_EVENTS","VOID_TAGS","SELFCLOSING_TAGS","isHTMLTag","isSVGTag","isMathMLTag","isVoidTag","isSelfClosingTag","isDelegatedEvent","isHtmlInputElement","isHtmlSelectElement","isHtmlTextAreaElement","isHtmlFormElement","isTextNode","isNode","STYLE_SEPARATOR_REGEX","PROPERTY_VALUE_SEPARATOR_REGEX","STYLE_COMMENT_REGEX","parseStyleString","cssText","styleObject","styleItem","parts","normalizeStyle","styleValue","normalizedStyleObject","normalizedItem","styleToString","propName","propValue","normalizedPropName","normalizeClassName","classValue","count","styleObjectToString"],"mappings":"aAOO,IAAMA,CAAAA,CAAYC,CAAAA,EACvBA,CAAAA,GAAQ,IAAA,EAAQ,OAAOA,CAAAA,EAAQ,SAQ1B,SAASC,CAAAA,CAAuBD,CAAAA,CAAiC,CACtE,OAAOE,CAAAA,CAAU,KAAKF,CAAG,CAAA,GAAM,kBACjC,CAMO,IAAMG,CAAAA,CAAU,KAAA,CAAM,QAOtB,SAASC,CAAAA,CAASJ,CAAAA,CAA6B,CACpD,OAAO,OAAOA,CAAAA,EAAQ,QACxB,CAOO,SAASK,CAAAA,CAASL,CAAAA,CAA6B,CACpD,OAAO,OAAOA,CAAAA,EAAQ,QACxB,CAMO,SAASM,CAAAA,CAAON,CAAAA,CAA2B,CAChD,OAAOA,CAAAA,GAAQ,IACjB,CAO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CAAY,CACjC,IAAMK,CAAAA,CAAYL,CAAAA,CAAWI,CAAQ,CAAA,CAGrC,GAAIvH,CAAAA,CAASwH,CAAS,CAAA,EAAKvH,CAAAA,CAASuH,CAAS,CAAA,CAAG,CAE9C,IAAMC,CAAAA,CAAqBF,CAAAA,CAAS,UAAA,CAAW,IAAI,CAAA,CAAIA,CAAAA,CAAWzE,CAAAA,CAAUyE,CAAQ,CAAA,CACpFT,CAAAA,EAAW,CAAA,EAAGW,CAAkB,IAAID,CAAS,CAAA,CAAA,EAC/C,CACF,CAEA,OAAOV,CACT","file":"shared.cjs.js","sourcesContent":["import { _toString } from './base';\n\n/**\n * Checks if a value is an object\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is an object, false otherwise\n */\nexport const isObject = (val: unknown): val is Record<any, unknown> =>\n val !== null && typeof val === 'object';\n\n/**\n * Checks if a value is a Promise\n * @template T - The type of the Promise's resolved value\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a Promise, false otherwise\n */\nexport function isPromise<T = unknown>(val: unknown): val is Promise<T> {\n return _toString.call(val) === '[object Promise]';\n}\n\n/**\n * Checks if a value is an Array\n * @type {(arg: unknown ) => arg is unknown []}\n */\nexport const isArray = Array.isArray;\n\n/**\n * Checks if a value is a string\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a string, false otherwise\n */\nexport function isString(val: unknown): val is string {\n return typeof val === 'string';\n}\n\n/**\n * Checks if a value is a number\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a number, false otherwise\n */\nexport function isNumber(val: unknown): val is number {\n return typeof val === 'number';\n}\n/**\n * Checks if a value is null\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is null, false otherwise\n */\nexport function isNull(val: unknown): val is null {\n return val === null;\n}\n\n/**\n * Checks if a value is a Symbol\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a Symbol, false otherwise\n */\nexport function isSymbol(val: unknown): val is symbol {\n return typeof val === 'symbol';\n}\n\n/**\n * Checks if a value is a Set\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a Set, false otherwise\n */\nexport function isSet(val: unknown): val is Set<unknown> {\n return _toString.call(val) === '[object Set]';\n}\n\n/**\n * Checks if a value is a WeakMap\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a WeakMap, false otherwise\n */\nexport function isWeakMap(val: unknown): val is WeakMap<any, unknown> {\n return _toString.call(val) === '[object WeakMap]';\n}\n\n/**\n * Checks if a value is a WeakSet\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a WeakSet, false otherwise\n */\nexport function isWeakSet(val: unknown): val is WeakSet<any> {\n return _toString.call(val) === '[object WeakSet]';\n}\n\n/**\n * Checks if a value is a Map\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a Map, false otherwise\n */\nexport function isMap(val: unknown): val is Map<unknown, unknown> {\n return _toString.call(val) === '[object Map]';\n}\n\n/**\n * Checks if a value is null or undefined\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is null or undefined, false otherwise\n */\nexport function isNil(val: unknown): val is null | undefined {\n return val === null || val === undefined;\n}\n\n/**\n * Checks if a value is a function\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a function, false otherwise\n */\nexport const isFunction = (val: unknown): val is Function => typeof val === 'function';\n\n/**\n * Checks if a value is falsy (false, null, or undefined)\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is falsy, false otherwise\n */\nexport function isFalsy(val: unknown): val is false | null | undefined {\n return val === false || val === null || val === undefined;\n}\n\n/**\n * Checks if a value is a primitive type (string, number, boolean, symbol, null, or undefined)\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a primitive type, false otherwise\n */\nexport const isPrimitive = (\n val: unknown,\n): val is string | number | boolean | symbol | null | undefined =>\n ['string', 'number', 'boolean', 'symbol', 'undefined'].includes(typeof val) || isNull(val);\n\n/**\n * Checks if a value is an HTMLElement\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is an HTMLElement, false otherwise\n */\nexport function isHTMLElement(val: unknown): val is HTMLElement {\n return val instanceof HTMLElement;\n}\n\n/**\n * Checks if a value is a plain object (created using Object constructor)\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a plain object, false otherwise\n */\nexport const isPlainObject = (val: unknown): val is object =>\n _toString.call(val) === '[object Object]';\n\n/**\n * String representation of a number\n * @typedef {`${number}`} StringNumber\n */\nexport type StringNumber = `${number}`;\n\n/**\n * Checks if a value is a string representation of a number\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a string number, false otherwise\n */\nexport function isStringNumber(val: unknown): val is StringNumber {\n if (!isString(val) || val === '') {\n return false;\n }\n return !Number.isNaN(Number(val));\n}\n\n/**\n * Checks if a value is undefined\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is undefined, false otherwise\n */\nexport function isUndefined(val: unknown): val is undefined {\n return typeof val === 'undefined';\n}\n\n/**\n * Checks if a value is a boolean\n * @param {unknown} val - The value to check\n * @returns {boolean} - Returns true if the value is a boolean, false otherwise\n */\nexport function isBoolean(val: unknown): val is boolean {\n return typeof val === 'boolean';\n}\n\nexport function isNaN(val: unknown): val is number {\n return Number.isNaN(val);\n}\n","import { isArray, isString } from './is';\n\n/**\n * Reference to Object.prototype.toString\n * @type {Function}\n */\nexport const _toString = Object.prototype.toString;\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Reference to Object.assign\n * @type {Function}\n */\nexport const extend = Object.assign;\n\n/**\n * Checks if an object has a specific property\n * @template T\n * @param {object} val - The target object to check\n * @param {string | symbol} key - The property name to check for\n * @returns {key is keyof T} - Returns true if the object has the property, false otherwise\n */\nexport const hasOwn = (val: object, key: string | symbol): key is keyof typeof val =>\n hasOwnProperty.call(val, key);\n/**\n * Forces a value to be an array\n * @template T - The type of array elements\n * @param {T | T[]} data - The data to convert, can be a single element or an array\n * @returns {T[]} - The resulting array\n */\nexport function coerceArray<T>(data: T | T[]): T[] {\n return isArray(data) ? data : [data];\n}\n\n/**\n * Checks if a value has changed\n * @param {unknown } value - The new value\n * @param {unknown } oldValue - The old value\n * @returns {boolean} - Returns true if the value has changed, false otherwise\n */\nexport const hasChanged = (value: unknown, oldValue: unknown): boolean =>\n !Object.is(value, oldValue);\n\n/**\n * Empty function, used for defaults and placeholders\n * @type {Function}\n */\nexport const noop = Function.prototype as () => void;\n\n/**\n * Checks if a string starts with a specified substring\n *\n * Uses indexOf for better performance in most cases\n * @see https://www.measurethat.net/Benchmarks/Show/12350/0/startswith-vs-test-vs-match-vs-indexof#latest_results_block\n * @param {string} str - The string to check\n * @param {string} searchString - The substring to search for\n * @returns {boolean} - Returns true if the string starts with the substring, false otherwise\n */\nexport function startsWith(str: string, searchString: string): boolean {\n if (!isString(str)) {\n return false;\n }\n return str.indexOf(searchString) === 0;\n}\n\n/**\n * Generates an 8-character random string as a unique identifier\n *\n * Note: Uses Math.random() which is not cryptographically secure.\n * For security-sensitive use cases, consider using crypto.getRandomValues()\n * @returns {string} - The generated unique identifier\n */\nexport function generateUniqueId(): string {\n const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let result = '';\n const charactersLength = characters.length;\n for (let i = 0; i < 8; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n}\n\n/**\n * Checks if the current environment is a browser\n * @returns {boolean} - Returns true if in a browser environment, false otherwise\n */\nexport function isBrowser(): boolean {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * Creates a cached version of a string processing function\n * @template T - The function type\n * @param {T} fn - The string processing function to cache\n * @returns {T} - The cached function\n */\nexport const cacheStringFunction = <T extends (str: string) => string>(fn: T): T => {\n const cache: Record<string, string> = Object.create(null);\n return ((str: string) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n }) as T;\n};\n\n/**\n * Read-only empty object\n * @type {Readonly<Record<string, unknown >>}\n */\nexport const EMPTY_OBJ: { readonly [key: string]: unknown } = Object.freeze({});\n\n/**\n * Read-only empty array\n * @type {readonly never[]}\n */\nexport const EMPTY_ARR: readonly never[] = Object.freeze([]);\n\n/**\n * Checks if a property name is an event handler (starts with 'on' followed by uppercase letter)\n *\n * Matches patterns like: onClick, onChange, onKeyDown (but not 'onclick' or 'on123')\n * @param {string} key - The property name to check\n * @returns {boolean} - Returns true if the property is an event handler, false otherwise\n */\nexport const isOn = (key: string): boolean =>\n key.charCodeAt(0) === 111 /* o */ &&\n key.charCodeAt(1) === 110 /* n */ &&\n key.charCodeAt(2) >= 65 && // uppercase letter A-Z\n key.charCodeAt(2) <= 90;\n\ndeclare let global: {};\n\nlet _globalThis: unknown;\n/**\n * Gets the global object for the current environment\n * @returns {unknown } - The global object for the current environment\n */\nexport const getGlobalThis = (): unknown => {\n return (\n _globalThis ||\n (_globalThis =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {})\n );\n};\n","import { cacheStringFunction } from './base';\n\n/**\n * Regular expression for converting camelCase to kebab-case\n * @type {RegExp}\n */\nconst hyphenateRE = /\\B([A-Z])/g;\n\n/**\n * Converts a camelCase string to kebab-case\n * Example: myFunction -> my-function\n * @param {string} str - The camelCase string to convert\n * @returns {string} - The kebab-case string\n */\nexport const kebabCase: (str: string) => string = cacheStringFunction((str: string) =>\n str.replaceAll(hyphenateRE, '-$1').toLowerCase(),\n);\n\n/**\n * Regular expression for converting kebab-case or snake_case to camelCase\n * @type {RegExp}\n */\nconst camelizeRE = /[_-](\\w)/g;\n\n/**\n * Converts a kebab-case or snake_case string to camelCase\n * Example: my-function or my_function -> myFunction\n * @param {string} str - The kebab-case or snake_case string to convert\n * @returns {string} - The camelCase string\n */\nexport const camelCase: (str: string) => string = cacheStringFunction((str: string): string => {\n // Remove leading and trailing hyphens or underscores\n str = str.replaceAll(/^[_-]+|[_-]+$/g, '');\n // Replace consecutive hyphens or underscores with a single hyphen\n str = str.replaceAll(/[_-]+/g, '-');\n // Convert to camelCase\n return str.replaceAll(camelizeRE, (_, c) => c.toUpperCase());\n});\n\n/**\n * Capitalizes the first letter of a string\n * Example: hello -> Hello\n * @template T - The input string type\n * @param {T} str - The string to capitalize\n * @returns {Capitalize<T>} - The capitalized string\n */\nexport const capitalize: <T extends string>(str: T) => Capitalize<T> = cacheStringFunction(\n <T extends string>(str: T) => {\n return (str.charAt(0).toUpperCase() + str.slice(1)) as Capitalize<T>;\n },\n);\n","/**\n * Outputs a warning level log message\n * @param {string} msg - The warning message\n * @param {...unknown } args - Additional arguments to log\n */\nexport function warn(msg: string, ...args: unknown[]): void {\n console.warn(`[Essor warn]: ${msg}`, ...args);\n}\n\n/**\n * Outputs an info level log message\n * @param {string} msg - The info message\n * @param {...unknown } args - Additional arguments to log\n */\nexport function info(msg: string, ...args: unknown[]): void {\n // eslint-disable-next-line no-console\n console.info(`[Essor info]: ${msg}`, ...args);\n}\n\n/**\n * Outputs an error level log message\n * @param {string} msg - The error message\n * @param {...unknown } args - Additional arguments to log\n */\nexport function error(msg: string, ...args: unknown[]): void {\n console.error(`[Essor error]: ${msg}`, ...args);\n}\n","/**\n * Regular expression for matching HTML special characters\n * @type {RegExp}\n */\nconst escapeRE = /[\"&'<>]/;\n\n/**\n * Escapes HTML special characters in a string to their corresponding entity references\n * @param {unknown} string - The string to escapeHTML\n * @returns {string} - The escaped string\n */\nexport function escapeHTML(string: unknown): string {\n const str = `${string}`;\n const match = escapeRE.exec(str);\n\n if (!match) {\n return str;\n }\n\n let html = '';\n let escaped: string;\n let index: number;\n let lastIndex = 0;\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escaped = '"';\n break;\n case 38: // &\n escaped = '&';\n break;\n case 39: // '\n escaped = ''';\n break;\n case 60: // <\n escaped = '<';\n break;\n case 62: // >\n escaped = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.slice(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escaped;\n }\n\n return lastIndex !== index ? html + str.slice(lastIndex, index) : html;\n}\n\n/**\n * Regular expression for stripping HTML comment markers\n * Reference: https://www.w3.org/TR/html52/syntax.html#comments\n * @type {RegExp}\n */\nconst commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;\n\n/**\n * Strips special characters from HTML comments\n * @param {string} src - The source string\n * @returns {string} - The cleaned string\n */\nexport function escapeHTMLComment(src: string): string {\n return src.replaceAll(commentStripRE, '');\n}\n\n/**\n * Regular expression for matching special characters in CSS variable names\n * @type {RegExp}\n */\nexport const cssVarNameEscapeSymbolsRE = /[ !\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~]/g;\n\n/**\n * Escapes special characters in CSS variable names\n * @param {string} key - The CSS variable name\n * @param {boolean} doubleEscape - Whether to apply double escaping\n * @returns {string} - The escaped CSS variable name\n */\nexport function getEscapedCssVarName(key: string, doubleEscape: boolean): string {\n return key.replaceAll(cssVarNameEscapeSymbolsRE, s =>\n doubleEscape ? (s === '\"' ? '\\\\\\\\\\\\\"' : `\\\\\\\\${s}`) : `\\\\${s}`,\n );\n}\n","/**\n * Make a map and return a function for checking if a key\n * is in that map.\n * IMPORTANT: all calls of this function must be prefixed with\n * \\/\\*#\\_\\_PURE\\_\\_\\*\\/\n * So that rollup can tree-shake them if necessary.\n */\n\n/*! #__NO_SIDE_EFFECTS__ */\n\nimport { hasOwn } from './base';\nimport { error } from './logger';\n\nexport function makeMap(str: string): (key: string) => boolean {\n const map = Object.create(null);\n for (const key of str.split(',')) {\n map[key] = 1;\n }\n return val => val in map;\n}\n\n/**\n * On the client we only need to offer special cases for boolean attributes that\n * have different names from their corresponding dom properties:\n * - itemscope -> N/A\n * - allowfullscreen -> allowFullscreen\n * - formnovalidate -> formNoValidate\n * - ismap -> isMap\n * - nomodule -> noModule\n * - novalidate -> noValidate\n * - readonly -> readOnly\n */\nconst specialBooleanAttrs =\n 'itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly';\nexport const isSpecialBooleanAttr: (key: string) => boolean =\n /*@__PURE__*/ makeMap(specialBooleanAttrs);\n\n/**\n * The full list is needed during SSR to produce the correct initial markup.\n */\nexport const isBooleanAttr: (key: string) => boolean = /*@__PURE__*/ makeMap(\n `${specialBooleanAttrs},async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`,\n);\n\n/**\n * Boolean attributes should be included if the value is truthy or ''.\n * e.g. `<select multiple>` compiles to `{ multiple: '' }`\n */\nexport function includeBooleanAttr(value: unknown): boolean {\n return !!value || value === '';\n}\n\nconst unsafeAttrCharRE = /[\\t\\n\\f \"'/=>]/;\nconst attrValidationCache: Record<string, boolean> = {};\n\nexport function isSSRSafeAttrName(name: string): boolean {\n if (hasOwn(attrValidationCache, name)) {\n return attrValidationCache[name];\n }\n const isUnsafe = unsafeAttrCharRE.test(name);\n if (isUnsafe) {\n if (__DEV__) {\n error(`unsafe attribute name: ${name}`);\n }\n }\n return (attrValidationCache[name] = !isUnsafe);\n}\n\nexport const propsToAttrMap: Record<string, string | undefined> = {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n};\n\n/**\n * Known attributes, this is used for stringification of runtime static nodes\n * so that we don't stringify bindings that cannot be set from HTML.\n * Don't also forget to allow `data-*` and `aria-*`!\n * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\n */\nexport const isKnownHtmlAttr: (key: string) => boolean = /*@__PURE__*/ makeMap(\n 'accept,accept-charset,accesskey,action,align,allow,alt,async,' +\n 'autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,' +\n 'border,buffered,capture,challenge,charset,checked,cite,class,code,' +\n 'codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,' +\n 'coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,' +\n 'disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,' +\n 'formaction,formenctype,formmethod,formnovalidate,formtarget,headers,' +\n 'height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,' +\n 'ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,' +\n 'manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,' +\n 'open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,' +\n 'referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,' +\n 'selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,' +\n 'start,step,style,summary,tabindex,target,title,translate,type,usemap,' +\n 'value,width,wrap',\n);\n\n/**\n * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute\n */\nexport const isKnownSvgAttr: (key: string) => boolean = /*@__PURE__*/ makeMap(\n 'xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,' +\n 'arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,' +\n 'baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,' +\n 'clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,' +\n 'color-interpolation-filters,color-profile,color-rendering,' +\n 'contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,' +\n 'descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,' +\n 'dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,' +\n 'fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,' +\n 'font-family,font-size,font-size-adjust,font-stretch,font-style,' +\n 'font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,' +\n 'glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,' +\n 'gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,' +\n 'horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,' +\n 'k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,' +\n 'lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,' +\n 'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,' +\n 'mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,' +\n 'name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,' +\n 'overflow,overline-position,overline-thickness,panose-1,paint-order,path,' +\n 'pathLength,patternContentUnits,patternTransform,patternUnits,ping,' +\n 'pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,' +\n 'preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,' +\n 'rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,' +\n 'restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,' +\n 'specularConstant,specularExponent,speed,spreadMethod,startOffset,' +\n 'stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,' +\n 'strikethrough-position,strikethrough-thickness,string,stroke,' +\n 'stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,' +\n 'stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,' +\n 'systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,' +\n 'text-decoration,text-rendering,textLength,to,transform,transform-origin,' +\n 'type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,' +\n 'unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,' +\n 'v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,' +\n 'vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,' +\n 'writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,' +\n 'xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,' +\n 'xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan',\n);\n\n/**\n * Shared between server-renderer and runtime-core hydration logic\n */\nexport function isRenderAbleAttrValue(value: unknown): boolean {\n if (value == null) {\n return false;\n }\n const type = typeof value;\n return type === 'string' || type === 'number' || type === 'boolean';\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element\nconst HTML_TAGS =\n 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +\n 'header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +\n 'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +\n 'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +\n 'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +\n 'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +\n 'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +\n 'option,output,progress,select,textarea,details,dialog,menu,' +\n 'summary,template,blockquote,iframe,tfoot';\n\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Element\nconst SVG_TAGS =\n 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +\n 'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +\n 'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +\n 'feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +\n 'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +\n 'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +\n 'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +\n 'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +\n 'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +\n 'text,textPath,title,tspan,unknown,use,view';\n\n// https://www.w3.org/TR/mathml4/ (content elements excluded)\nconst MATH_TAGS =\n 'annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,' +\n 'merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,' +\n 'mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,' +\n 'mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,' +\n 'msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics';\n\nconst DELEGATED_EVENTS =\n 'beforeinput,click,dblclick,contextmenu,focusin,focusout,input,keydown,' +\n 'keyup,mousedown,mousemove,mouseout,mouseover,mouseup,pointerdown,' +\n 'pointermove,pointerout,pointerover,pointerup,touchend,touchmove,touchstart';\n\nconst VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';\n\nconst SELFCLOSING_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';\n\nexport const isHTMLTag: (key: string) => boolean = /*@__PURE__*/ makeMap(HTML_TAGS);\n\nexport const isSVGTag: (key: string) => boolean = /*@__PURE__*/ makeMap(SVG_TAGS);\n\nexport const isMathMLTag: (key: string) => boolean = /*@__PURE__*/ makeMap(MATH_TAGS);\n\nexport const isVoidTag: (key: string) => boolean = /*@__PURE__*/ makeMap(VOID_TAGS);\n\nexport const isSelfClosingTag: (key: string) => boolean = /*@__PURE__*/ makeMap(SELFCLOSING_TAGS);\n\nexport const isDelegatedEvent: (key: string) => boolean = /*@__PURE__*/ makeMap(DELEGATED_EVENTS);\n","/**\n * Checks if a value is an HTMLInputElement\n * @param val - The value to check\n * @returns true if the value is an HTMLInputElement\n */\nexport function isHtmlInputElement(val: unknown): val is HTMLInputElement {\n return typeof HTMLInputElement !== 'undefined' && val instanceof HTMLInputElement;\n}\n\n/**\n * Checks if a value is an HTMLSelectElement\n * @param val - The value to check\n * @returns true if the value is an HTMLSelectElement\n */\nexport function isHtmlSelectElement(val: unknown): val is HTMLSelectElement {\n return typeof HTMLSelectElement !== 'undefined' && val instanceof HTMLSelectElement;\n}\n\n/**\n * Checks if a value is an HTMLTextAreaElement\n * @param val - The value to check\n * @returns true if the value is an HTMLTextAreaElement\n */\nexport function isHtmlTextAreaElement(val: unknown): val is HTMLTextAreaElement {\n return typeof HTMLTextAreaElement !== 'undefined' && val instanceof HTMLTextAreaElement;\n}\n\n/**\n * Checks if a value is an HTMLFormElement\n * @param val - The value to check\n * @returns true if the value is an HTMLFormElement\n */\nexport function isHtmlFormElement(val: unknown): val is HTMLFormElement {\n return typeof HTMLFormElement !== 'undefined' && val instanceof HTMLFormElement;\n}\n\n/**\n * Checks if a value is a Text node\n * @param val - The value to check\n * @returns true if the value is a Text node\n */\nexport function isTextNode(val: unknown): val is Text {\n return typeof Text !== 'undefined' && val instanceof Text;\n}\n\n/**\n * Checks if a value is a Node\n * @param val - The value to check\n * @returns true if the value is a Node\n */\nexport function isNode(val: unknown): val is Node {\n return typeof Node !== 'undefined' && val instanceof Node;\n}\n","/**\n * Normalization utilities for class names and styles\n * Shared between template (client) and server packages\n */\n\nimport { isArray, isNumber, isObject, isString } from './is';\nimport { kebabCase } from './string';\n\n/**\n * Normalized style object type\n */\nexport type NormalizedStyle = Record<string, string | number>;\n\n/**\n * Style value type that can be normalized\n */\nexport type StyleValue = string | NormalizedStyle | StyleValue[] | null | undefined;\n\n/**\n * Class value type that can be normalized\n */\nexport type ClassValue = string | Record<string, boolean> | ClassValue[] | null | undefined;\n\n// Style parsing related regular expressions\n/** Semicolon separator regex, excludes semicolons within parentheses */\nconst STYLE_SEPARATOR_REGEX = /;(?![^(]*\\))/g;\n/** Property value separator regex */\nconst PROPERTY_VALUE_SEPARATOR_REGEX = /:([\\s\\S]+)/;\n/** Style comment regex */\nconst STYLE_COMMENT_REGEX = /\\/\\*[\\s\\S]*?\\*\\//g;\n\n/**\n * Parse CSS style string into object format\n *\n * @param cssText - CSS style string\n * @returns Normalized style object\n */\nexport function parseStyleString(cssText: string): NormalizedStyle {\n const styleObject: NormalizedStyle = {};\n\n cssText\n .replaceAll(STYLE_COMMENT_REGEX, '')\n .split(STYLE_SEPARATOR_REGEX)\n .forEach(styleItem => {\n if (styleItem) {\n const parts = styleItem.split(PROPERTY_VALUE_SEPARATOR_REGEX);\n if (parts.length > 1) {\n styleObject[parts[0].trim()] = parts[1].trim();\n }\n }\n });\n\n return styleObject;\n}\n\n/**\n * Normalize style value to a unified format\n *\n * @param styleValue - Original style value (object, string, or array)\n * @returns Normalized style object or string\n */\nexport function normalizeStyle(styleValue: unknown): NormalizedStyle | string | undefined {\n // Handle array format styles\n if (isArray(styleValue)) {\n const normalizedStyleObject: NormalizedStyle = {};\n\n for (const styleItem of styleValue) {\n const normalizedItem = isString(styleItem)\n ? parseStyleString(styleItem)\n : (normalizeStyle(styleItem) as NormalizedStyle);\n\n if (normalizedItem) {\n for (const key in normalizedItem) {\n normalizedStyleObject[key] = normalizedItem[key];\n }\n }\n }\n\n return normalizedStyleObject;\n }\n\n // Handle string or object format styles\n if (isString(styleValue) || isObject(styleValue)) {\n return styleValue as NormalizedStyle | string;\n }\n\n return undefined;\n}\n\n/**\n * Convert style object to CSS string\n *\n * @param styleValue - Style object or string\n * @returns Formatted CSS string\n */\nexport function styleToString(styleValue: NormalizedStyle | string | undefined): string {\n if (!styleValue) {\n return '';\n }\n\n if (isString(styleValue)) {\n return styleValue;\n }\n\n let cssText = '';\n for (const propName in styleValue) {\n const propValue = styleValue[propName];\n\n if (isString(propValue) || isNumber(propValue)) {\n // Keep CSS variables as is, convert other properties to kebab-case\n const normalizedPropName = propName.startsWith('--') ? propName : kebabCase(propName);\n cssText += `${normalizedPropName}:${propValue};`;\n }\n }\n\n return cssText;\n}\n\n/**\n * Normalize class value to a unified string format\n *\n * @param classValue - Original class value (string, array, or object)\n * @returns Normalized class name string\n */\nexport function normalizeClassName(classValue: unknown): string {\n if (classValue == null) {\n return '';\n }\n\n if (isString(classValue)) {\n return classValue.trim();\n }\n\n // Handle arrays\n if (isArray(classValue)) {\n return classValue.map(normalizeClassName).filter(Boolean).join(' ');\n }\n\n // Handle objects (conditional classes)\n if (isObject(classValue)) {\n let count = 0;\n for (const key in classValue) {\n if (classValue[key]) count++;\n }\n\n if (count === 0) return '';\n\n const result: string[] = new Array(count);\n let index = 0;\n\n for (const key in classValue) {\n if (classValue[key]) {\n result[index++] = key;\n }\n }\n\n return result.join(' ');\n }\n\n return String(classValue).trim();\n}\n/**\n * Convert style object to CSS string\n *\n * Handle different types of style values, and apply CSS variable and kebab-case transformations\n *\n * @param styleValue Style object or string\n * @returns Formatted CSS string\n */\nexport function styleObjectToString(styleValue: NormalizedStyle | string | undefined): string {\n // Check for empty values\n if (!styleValue) {\n return '';\n }\n\n // Return string values directly\n if (isString(styleValue)) {\n return styleValue;\n }\n\n // Convert object to string\n let cssText = '';\n for (const propName in styleValue) {\n const propValue = styleValue[propName];\n\n // Only process valid string or number values\n if (isString(propValue) || isNumber(propValue)) {\n // Keep CSS variables as is, convert other properties to kebab-case\n const normalizedPropName = propName.startsWith('--') ? propName : kebabCase(propName);\n cssText += `${normalizedPropName}:${propValue};`;\n }\n }\n\n return cssText;\n}\n"]}
|
package/dist/shared.d.cts
CHANGED
|
@@ -1,80 +1,408 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Reference to Object.assign
|
|
3
|
+
* @type {Function}
|
|
4
|
+
*/
|
|
2
5
|
declare const extend: {
|
|
3
6
|
<T extends {}, U>(target: T, source: U): T & U;
|
|
4
7
|
<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
|
|
5
8
|
<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
|
|
6
9
|
(target: object, ...sources: any[]): any;
|
|
7
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Checks if an object has a specific property
|
|
13
|
+
* @template T
|
|
14
|
+
* @param {object} val - The target object to check
|
|
15
|
+
* @param {string | symbol} key - The property name to check for
|
|
16
|
+
* @returns {key is keyof T} - Returns true if the object has the property, false otherwise
|
|
17
|
+
*/
|
|
8
18
|
declare const hasOwn: (val: object, key: string | symbol) => key is keyof typeof val;
|
|
19
|
+
/**
|
|
20
|
+
* Forces a value to be an array
|
|
21
|
+
* @template T - The type of array elements
|
|
22
|
+
* @param {T | T[]} data - The data to convert, can be a single element or an array
|
|
23
|
+
* @returns {T[]} - The resulting array
|
|
24
|
+
*/
|
|
9
25
|
declare function coerceArray<T>(data: T | T[]): T[];
|
|
10
|
-
declare const hasChanged: (value: any, oldValue: any) => boolean;
|
|
11
|
-
declare const noop: () => void;
|
|
12
26
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @
|
|
16
|
-
|
|
17
|
-
* @param {string} str - The input string to check.
|
|
18
|
-
* @param {string} searchString - The substring to check for at the beginning of the input string.
|
|
19
|
-
* @return {boolean} Returns true if the input string starts with the specified substring, otherwise false.
|
|
27
|
+
* Checks if a value has changed
|
|
28
|
+
* @param {unknown } value - The new value
|
|
29
|
+
* @param {unknown } oldValue - The old value
|
|
30
|
+
* @returns {boolean} - Returns true if the value has changed, false otherwise
|
|
20
31
|
*/
|
|
21
|
-
declare
|
|
32
|
+
declare const hasChanged: (value: unknown, oldValue: unknown) => boolean;
|
|
22
33
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @
|
|
25
|
-
* @returns The escaped string.
|
|
34
|
+
* Empty function, used for defaults and placeholders
|
|
35
|
+
* @type {Function}
|
|
26
36
|
*/
|
|
27
|
-
declare
|
|
28
|
-
type ExcludeType = ((key: string | symbol) => boolean) | (string | symbol)[];
|
|
37
|
+
declare const noop: () => void;
|
|
29
38
|
/**
|
|
30
|
-
* Checks if a
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
39
|
+
* Checks if a string starts with a specified substring
|
|
40
|
+
*
|
|
41
|
+
* Uses indexOf for better performance in most cases
|
|
42
|
+
* @see https://www.measurethat.net/Benchmarks/Show/12350/0/startswith-vs-test-vs-match-vs-indexof#latest_results_block
|
|
43
|
+
* @param {string} str - The string to check
|
|
44
|
+
* @param {string} searchString - The substring to search for
|
|
45
|
+
* @returns {boolean} - Returns true if the string starts with the substring, false otherwise
|
|
34
46
|
*/
|
|
35
|
-
declare function
|
|
47
|
+
declare function startsWith(str: string, searchString: string): boolean;
|
|
36
48
|
/**
|
|
37
|
-
* Generates
|
|
38
|
-
*
|
|
39
|
-
*
|
|
49
|
+
* Generates an 8-character random string as a unique identifier
|
|
50
|
+
*
|
|
51
|
+
* Note: Uses Math.random() which is not cryptographically secure.
|
|
52
|
+
* For security-sensitive use cases, consider using crypto.getRandomValues()
|
|
53
|
+
* @returns {string} - The generated unique identifier
|
|
40
54
|
*/
|
|
41
55
|
declare function generateUniqueId(): string;
|
|
42
56
|
/**
|
|
43
|
-
* Checks if the current environment is a browser
|
|
44
|
-
* @returns
|
|
57
|
+
* Checks if the current environment is a browser
|
|
58
|
+
* @returns {boolean} - Returns true if in a browser environment, false otherwise
|
|
45
59
|
*/
|
|
46
60
|
declare function isBrowser(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Creates a cached version of a string processing function
|
|
63
|
+
* @template T - The function type
|
|
64
|
+
* @param {T} fn - The string processing function to cache
|
|
65
|
+
* @returns {T} - The cached function
|
|
66
|
+
*/
|
|
67
|
+
declare const cacheStringFunction: <T extends (str: string) => string>(fn: T) => T;
|
|
68
|
+
/**
|
|
69
|
+
* Read-only empty object
|
|
70
|
+
* @type {Readonly<Record<string, unknown >>}
|
|
71
|
+
*/
|
|
72
|
+
declare const EMPTY_OBJ: {
|
|
73
|
+
readonly [key: string]: unknown;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Read-only empty array
|
|
77
|
+
* @type {readonly never[]}
|
|
78
|
+
*/
|
|
79
|
+
declare const EMPTY_ARR: readonly never[];
|
|
80
|
+
/**
|
|
81
|
+
* Checks if a property name is an event handler (starts with 'on' followed by uppercase letter)
|
|
82
|
+
*
|
|
83
|
+
* Matches patterns like: onClick, onChange, onKeyDown (but not 'onclick' or 'on123')
|
|
84
|
+
* @param {string} key - The property name to check
|
|
85
|
+
* @returns {boolean} - Returns true if the property is an event handler, false otherwise
|
|
86
|
+
*/
|
|
87
|
+
declare const isOn: (key: string) => boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Gets the global object for the current environment
|
|
90
|
+
* @returns {unknown } - The global object for the current environment
|
|
91
|
+
*/
|
|
92
|
+
declare const getGlobalThis: () => unknown;
|
|
47
93
|
|
|
48
|
-
|
|
49
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Checks if a value is an object
|
|
96
|
+
* @param {unknown} val - The value to check
|
|
97
|
+
* @returns {boolean} - Returns true if the value is an object, false otherwise
|
|
98
|
+
*/
|
|
99
|
+
declare const isObject: (val: unknown) => val is Record<any, unknown>;
|
|
100
|
+
/**
|
|
101
|
+
* Checks if a value is a Promise
|
|
102
|
+
* @template T - The type of the Promise's resolved value
|
|
103
|
+
* @param {unknown} val - The value to check
|
|
104
|
+
* @returns {boolean} - Returns true if the value is a Promise, false otherwise
|
|
105
|
+
*/
|
|
106
|
+
declare function isPromise<T = unknown>(val: unknown): val is Promise<T>;
|
|
107
|
+
/**
|
|
108
|
+
* Checks if a value is an Array
|
|
109
|
+
* @type {(arg: unknown ) => arg is unknown []}
|
|
110
|
+
*/
|
|
50
111
|
declare const isArray: (arg: any) => arg is any[];
|
|
112
|
+
/**
|
|
113
|
+
* Checks if a value is a string
|
|
114
|
+
* @param {unknown} val - The value to check
|
|
115
|
+
* @returns {boolean} - Returns true if the value is a string, false otherwise
|
|
116
|
+
*/
|
|
51
117
|
declare function isString(val: unknown): val is string;
|
|
118
|
+
/**
|
|
119
|
+
* Checks if a value is a number
|
|
120
|
+
* @param {unknown} val - The value to check
|
|
121
|
+
* @returns {boolean} - Returns true if the value is a number, false otherwise
|
|
122
|
+
*/
|
|
123
|
+
declare function isNumber(val: unknown): val is number;
|
|
124
|
+
/**
|
|
125
|
+
* Checks if a value is null
|
|
126
|
+
* @param {unknown} val - The value to check
|
|
127
|
+
* @returns {boolean} - Returns true if the value is null, false otherwise
|
|
128
|
+
*/
|
|
129
|
+
declare function isNull(val: unknown): val is null;
|
|
130
|
+
/**
|
|
131
|
+
* Checks if a value is a Symbol
|
|
132
|
+
* @param {unknown} val - The value to check
|
|
133
|
+
* @returns {boolean} - Returns true if the value is a Symbol, false otherwise
|
|
134
|
+
*/
|
|
52
135
|
declare function isSymbol(val: unknown): val is symbol;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Checks if a value is a Set
|
|
138
|
+
* @param {unknown} val - The value to check
|
|
139
|
+
* @returns {boolean} - Returns true if the value is a Set, false otherwise
|
|
140
|
+
*/
|
|
141
|
+
declare function isSet(val: unknown): val is Set<unknown>;
|
|
142
|
+
/**
|
|
143
|
+
* Checks if a value is a WeakMap
|
|
144
|
+
* @param {unknown} val - The value to check
|
|
145
|
+
* @returns {boolean} - Returns true if the value is a WeakMap, false otherwise
|
|
146
|
+
*/
|
|
147
|
+
declare function isWeakMap(val: unknown): val is WeakMap<any, unknown>;
|
|
148
|
+
/**
|
|
149
|
+
* Checks if a value is a WeakSet
|
|
150
|
+
* @param {unknown} val - The value to check
|
|
151
|
+
* @returns {boolean} - Returns true if the value is a WeakSet, false otherwise
|
|
152
|
+
*/
|
|
153
|
+
declare function isWeakSet(val: unknown): val is WeakSet<any>;
|
|
154
|
+
/**
|
|
155
|
+
* Checks if a value is a Map
|
|
156
|
+
* @param {unknown} val - The value to check
|
|
157
|
+
* @returns {boolean} - Returns true if the value is a Map, false otherwise
|
|
158
|
+
*/
|
|
159
|
+
declare function isMap(val: unknown): val is Map<unknown, unknown>;
|
|
160
|
+
/**
|
|
161
|
+
* Checks if a value is null or undefined
|
|
162
|
+
* @param {unknown} val - The value to check
|
|
163
|
+
* @returns {boolean} - Returns true if the value is null or undefined, false otherwise
|
|
164
|
+
*/
|
|
165
|
+
declare function isNil(val: unknown): val is null | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Checks if a value is a function
|
|
168
|
+
* @param {unknown} val - The value to check
|
|
169
|
+
* @returns {boolean} - Returns true if the value is a function, false otherwise
|
|
170
|
+
*/
|
|
58
171
|
declare const isFunction: (val: unknown) => val is Function;
|
|
59
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Checks if a value is falsy (false, null, or undefined)
|
|
174
|
+
* @param {unknown} val - The value to check
|
|
175
|
+
* @returns {boolean} - Returns true if the value is falsy, false otherwise
|
|
176
|
+
*/
|
|
177
|
+
declare function isFalsy(val: unknown): val is false | null | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Checks if a value is a primitive type (string, number, boolean, symbol, null, or undefined)
|
|
180
|
+
* @param {unknown} val - The value to check
|
|
181
|
+
* @returns {boolean} - Returns true if the value is a primitive type, false otherwise
|
|
182
|
+
*/
|
|
60
183
|
declare const isPrimitive: (val: unknown) => val is string | number | boolean | symbol | null | undefined;
|
|
61
|
-
|
|
184
|
+
/**
|
|
185
|
+
* Checks if a value is an HTMLElement
|
|
186
|
+
* @param {unknown} val - The value to check
|
|
187
|
+
* @returns {boolean} - Returns true if the value is an HTMLElement, false otherwise
|
|
188
|
+
*/
|
|
189
|
+
declare function isHTMLElement(val: unknown): val is HTMLElement;
|
|
190
|
+
/**
|
|
191
|
+
* Checks if a value is a plain object (created using Object constructor)
|
|
192
|
+
* @param {unknown} val - The value to check
|
|
193
|
+
* @returns {boolean} - Returns true if the value is a plain object, false otherwise
|
|
194
|
+
*/
|
|
62
195
|
declare const isPlainObject: (val: unknown) => val is object;
|
|
196
|
+
/**
|
|
197
|
+
* String representation of a number
|
|
198
|
+
* @typedef {`${number}`} StringNumber
|
|
199
|
+
*/
|
|
63
200
|
type StringNumber = `${number}`;
|
|
201
|
+
/**
|
|
202
|
+
* Checks if a value is a string representation of a number
|
|
203
|
+
* @param {unknown} val - The value to check
|
|
204
|
+
* @returns {boolean} - Returns true if the value is a string number, false otherwise
|
|
205
|
+
*/
|
|
64
206
|
declare function isStringNumber(val: unknown): val is StringNumber;
|
|
207
|
+
/**
|
|
208
|
+
* Checks if a value is undefined
|
|
209
|
+
* @param {unknown} val - The value to check
|
|
210
|
+
* @returns {boolean} - Returns true if the value is undefined, false otherwise
|
|
211
|
+
*/
|
|
212
|
+
declare function isUndefined(val: unknown): val is undefined;
|
|
213
|
+
/**
|
|
214
|
+
* Checks if a value is a boolean
|
|
215
|
+
* @param {unknown} val - The value to check
|
|
216
|
+
* @returns {boolean} - Returns true if the value is a boolean, false otherwise
|
|
217
|
+
*/
|
|
218
|
+
declare function isBoolean(val: unknown): val is boolean;
|
|
219
|
+
declare function isNaN(val: unknown): val is number;
|
|
65
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Converts a camelCase string to kebab-case
|
|
223
|
+
* Example: myFunction -> my-function
|
|
224
|
+
* @param {string} str - The camelCase string to convert
|
|
225
|
+
* @returns {string} - The kebab-case string
|
|
226
|
+
*/
|
|
66
227
|
declare const kebabCase: (str: string) => string;
|
|
228
|
+
/**
|
|
229
|
+
* Converts a kebab-case or snake_case string to camelCase
|
|
230
|
+
* Example: my-function or my_function -> myFunction
|
|
231
|
+
* @param {string} str - The kebab-case or snake_case string to convert
|
|
232
|
+
* @returns {string} - The camelCase string
|
|
233
|
+
*/
|
|
67
234
|
declare const camelCase: (str: string) => string;
|
|
68
235
|
/**
|
|
69
|
-
* Capitalizes the first letter of a string
|
|
70
|
-
*
|
|
71
|
-
* @
|
|
72
|
-
* @
|
|
236
|
+
* Capitalizes the first letter of a string
|
|
237
|
+
* Example: hello -> Hello
|
|
238
|
+
* @template T - The input string type
|
|
239
|
+
* @param {T} str - The string to capitalize
|
|
240
|
+
* @returns {Capitalize<T>} - The capitalized string
|
|
73
241
|
*/
|
|
74
242
|
declare const capitalize: <T extends string>(str: T) => Capitalize<T>;
|
|
75
243
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
244
|
+
/**
|
|
245
|
+
* Outputs a warning level log message
|
|
246
|
+
* @param {string} msg - The warning message
|
|
247
|
+
* @param {...unknown } args - Additional arguments to log
|
|
248
|
+
*/
|
|
249
|
+
declare function warn(msg: string, ...args: unknown[]): void;
|
|
250
|
+
/**
|
|
251
|
+
* Outputs an info level log message
|
|
252
|
+
* @param {string} msg - The info message
|
|
253
|
+
* @param {...unknown } args - Additional arguments to log
|
|
254
|
+
*/
|
|
255
|
+
declare function info(msg: string, ...args: unknown[]): void;
|
|
256
|
+
/**
|
|
257
|
+
* Outputs an error level log message
|
|
258
|
+
* @param {string} msg - The error message
|
|
259
|
+
* @param {...unknown } args - Additional arguments to log
|
|
260
|
+
*/
|
|
261
|
+
declare function error(msg: string, ...args: unknown[]): void;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Escapes HTML special characters in a string to their corresponding entity references
|
|
265
|
+
* @param {unknown} string - The string to escapeHTML
|
|
266
|
+
* @returns {string} - The escaped string
|
|
267
|
+
*/
|
|
268
|
+
declare function escapeHTML(string: unknown): string;
|
|
269
|
+
/**
|
|
270
|
+
* Strips special characters from HTML comments
|
|
271
|
+
* @param {string} src - The source string
|
|
272
|
+
* @returns {string} - The cleaned string
|
|
273
|
+
*/
|
|
274
|
+
declare function escapeHTMLComment(src: string): string;
|
|
275
|
+
/**
|
|
276
|
+
* Escapes special characters in CSS variable names
|
|
277
|
+
* @param {string} key - The CSS variable name
|
|
278
|
+
* @param {boolean} doubleEscape - Whether to apply double escaping
|
|
279
|
+
* @returns {string} - The escaped CSS variable name
|
|
280
|
+
*/
|
|
281
|
+
declare function getEscapedCssVarName(key: string, doubleEscape: boolean): string;
|
|
282
|
+
|
|
283
|
+
declare const isSpecialBooleanAttr: (key: string) => boolean;
|
|
284
|
+
/**
|
|
285
|
+
* The full list is needed during SSR to produce the correct initial markup.
|
|
286
|
+
*/
|
|
287
|
+
declare const isBooleanAttr: (key: string) => boolean;
|
|
288
|
+
/**
|
|
289
|
+
* Boolean attributes should be included if the value is truthy or ''.
|
|
290
|
+
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
291
|
+
*/
|
|
292
|
+
declare function includeBooleanAttr(value: unknown): boolean;
|
|
293
|
+
declare function isSSRSafeAttrName(name: string): boolean;
|
|
294
|
+
declare const propsToAttrMap: Record<string, string | undefined>;
|
|
295
|
+
/**
|
|
296
|
+
* Known attributes, this is used for stringification of runtime static nodes
|
|
297
|
+
* so that we don't stringify bindings that cannot be set from HTML.
|
|
298
|
+
* Don't also forget to allow `data-*` and `aria-*`!
|
|
299
|
+
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
|
|
300
|
+
*/
|
|
301
|
+
declare const isKnownHtmlAttr: (key: string) => boolean;
|
|
302
|
+
/**
|
|
303
|
+
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
304
|
+
*/
|
|
305
|
+
declare const isKnownSvgAttr: (key: string) => boolean;
|
|
306
|
+
/**
|
|
307
|
+
* Shared between server-renderer and runtime-core hydration logic
|
|
308
|
+
*/
|
|
309
|
+
declare function isRenderAbleAttrValue(value: unknown): boolean;
|
|
310
|
+
declare const isHTMLTag: (key: string) => boolean;
|
|
311
|
+
declare const isSVGTag: (key: string) => boolean;
|
|
312
|
+
declare const isMathMLTag: (key: string) => boolean;
|
|
313
|
+
declare const isVoidTag: (key: string) => boolean;
|
|
314
|
+
declare const isSelfClosingTag: (key: string) => boolean;
|
|
315
|
+
declare const isDelegatedEvent: (key: string) => boolean;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Checks if a value is an HTMLInputElement
|
|
319
|
+
* @param val - The value to check
|
|
320
|
+
* @returns true if the value is an HTMLInputElement
|
|
321
|
+
*/
|
|
322
|
+
declare function isHtmlInputElement(val: unknown): val is HTMLInputElement;
|
|
323
|
+
/**
|
|
324
|
+
* Checks if a value is an HTMLSelectElement
|
|
325
|
+
* @param val - The value to check
|
|
326
|
+
* @returns true if the value is an HTMLSelectElement
|
|
327
|
+
*/
|
|
328
|
+
declare function isHtmlSelectElement(val: unknown): val is HTMLSelectElement;
|
|
329
|
+
/**
|
|
330
|
+
* Checks if a value is an HTMLTextAreaElement
|
|
331
|
+
* @param val - The value to check
|
|
332
|
+
* @returns true if the value is an HTMLTextAreaElement
|
|
333
|
+
*/
|
|
334
|
+
declare function isHtmlTextAreaElement(val: unknown): val is HTMLTextAreaElement;
|
|
335
|
+
/**
|
|
336
|
+
* Checks if a value is an HTMLFormElement
|
|
337
|
+
* @param val - The value to check
|
|
338
|
+
* @returns true if the value is an HTMLFormElement
|
|
339
|
+
*/
|
|
340
|
+
declare function isHtmlFormElement(val: unknown): val is HTMLFormElement;
|
|
341
|
+
/**
|
|
342
|
+
* Checks if a value is a Text node
|
|
343
|
+
* @param val - The value to check
|
|
344
|
+
* @returns true if the value is a Text node
|
|
345
|
+
*/
|
|
346
|
+
declare function isTextNode(val: unknown): val is Text;
|
|
347
|
+
/**
|
|
348
|
+
* Checks if a value is a Node
|
|
349
|
+
* @param val - The value to check
|
|
350
|
+
* @returns true if the value is a Node
|
|
351
|
+
*/
|
|
352
|
+
declare function isNode(val: unknown): val is Node;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Normalization utilities for class names and styles
|
|
356
|
+
* Shared between template (client) and server packages
|
|
357
|
+
*/
|
|
358
|
+
/**
|
|
359
|
+
* Normalized style object type
|
|
360
|
+
*/
|
|
361
|
+
type NormalizedStyle = Record<string, string | number>;
|
|
362
|
+
/**
|
|
363
|
+
* Style value type that can be normalized
|
|
364
|
+
*/
|
|
365
|
+
type StyleValue = string | NormalizedStyle | StyleValue[] | null | undefined;
|
|
366
|
+
/**
|
|
367
|
+
* Class value type that can be normalized
|
|
368
|
+
*/
|
|
369
|
+
type ClassValue = string | Record<string, boolean> | ClassValue[] | null | undefined;
|
|
370
|
+
/**
|
|
371
|
+
* Parse CSS style string into object format
|
|
372
|
+
*
|
|
373
|
+
* @param cssText - CSS style string
|
|
374
|
+
* @returns Normalized style object
|
|
375
|
+
*/
|
|
376
|
+
declare function parseStyleString(cssText: string): NormalizedStyle;
|
|
377
|
+
/**
|
|
378
|
+
* Normalize style value to a unified format
|
|
379
|
+
*
|
|
380
|
+
* @param styleValue - Original style value (object, string, or array)
|
|
381
|
+
* @returns Normalized style object or string
|
|
382
|
+
*/
|
|
383
|
+
declare function normalizeStyle(styleValue: unknown): NormalizedStyle | string | undefined;
|
|
384
|
+
/**
|
|
385
|
+
* Convert style object to CSS string
|
|
386
|
+
*
|
|
387
|
+
* @param styleValue - Style object or string
|
|
388
|
+
* @returns Formatted CSS string
|
|
389
|
+
*/
|
|
390
|
+
declare function styleToString(styleValue: NormalizedStyle | string | undefined): string;
|
|
391
|
+
/**
|
|
392
|
+
* Normalize class value to a unified string format
|
|
393
|
+
*
|
|
394
|
+
* @param classValue - Original class value (string, array, or object)
|
|
395
|
+
* @returns Normalized class name string
|
|
396
|
+
*/
|
|
397
|
+
declare function normalizeClassName(classValue: unknown): string;
|
|
398
|
+
/**
|
|
399
|
+
* Convert style object to CSS string
|
|
400
|
+
*
|
|
401
|
+
* Handle different types of style values, and apply CSS variable and kebab-case transformations
|
|
402
|
+
*
|
|
403
|
+
* @param styleValue Style object or string
|
|
404
|
+
* @returns Formatted CSS string
|
|
405
|
+
*/
|
|
406
|
+
declare function styleObjectToString(styleValue: NormalizedStyle | string | undefined): string;
|
|
79
407
|
|
|
80
|
-
export { type
|
|
408
|
+
export { type ClassValue, EMPTY_ARR, EMPTY_OBJ, type NormalizedStyle, type StringNumber, type StyleValue, cacheStringFunction, camelCase, capitalize, coerceArray, error, escapeHTML, escapeHTMLComment, extend, generateUniqueId, getEscapedCssVarName, getGlobalThis, hasChanged, hasOwn, includeBooleanAttr, info, isArray, isBoolean, isBooleanAttr, isBrowser, isDelegatedEvent, isFalsy, isFunction, isHTMLElement, isHTMLTag, isHtmlFormElement, isHtmlInputElement, isHtmlSelectElement, isHtmlTextAreaElement, isKnownHtmlAttr, isKnownSvgAttr, isMap, isMathMLTag, isNaN, isNil, isNode, isNull, isNumber, isObject, isOn, isPlainObject, isPrimitive, isPromise, isRenderAbleAttrValue, isSSRSafeAttrName, isSVGTag, isSelfClosingTag, isSet, isSpecialBooleanAttr, isString, isStringNumber, isSymbol, isTextNode, isUndefined, isVoidTag, isWeakMap, isWeakSet, kebabCase, noop, normalizeClassName, normalizeStyle, parseStyleString, propsToAttrMap, startsWith, styleObjectToString, styleToString, warn };
|