@estjs/shared 0.0.14-beta.9 → 0.0.15-beta.1
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 +2 -0
- package/dist/shared.cjs.js.map +1 -0
- package/dist/shared.d.cts +287 -42
- package/dist/shared.d.ts +287 -42
- package/dist/shared.dev.cjs.js +395 -0
- package/dist/shared.dev.cjs.js.map +1 -0
- package/dist/shared.dev.esm.js +311 -0
- package/dist/shared.dev.esm.js.map +1 -0
- package/dist/shared.esm.js +2 -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,2 @@
|
|
|
1
|
+
'use strict';var x=e=>e!==null&&typeof e=="object";function w(e){return a.call(e)==="[object Promise]"}var u=Array.isArray;function d(e){return typeof e=="string"}function v(e){return typeof e=="number"}function b(e){return e===null}function T(e){return typeof e=="symbol"}function A(e){return a.call(e)==="[object Set]"}function S(e){return a.call(e)==="[object WeakMap]"}function M(e){return a.call(e)==="[object WeakSet]"}function C(e){return a.call(e)==="[object Map]"}function E(e){return e==null}var m=e=>typeof e=="function";function N(e){return e===false||e===null||e===void 0}var O=e=>["string","number","boolean","symbol","undefined"].includes(typeof e)||b(e);function j(e){return e instanceof HTMLElement}var L=e=>a.call(e)==="[object Object]";function P(e){return !d(e)||e===""?false:!Number.isNaN(Number(e))}function R(e){return typeof e=="undefined"}function _(e){return typeof e=="boolean"}function z(e){return Number.isNaN(e)}var a=Object.prototype.toString,F=Object.prototype.hasOwnProperty,B=Object.assign,f=(e,t)=>F.call(e,t);function U(e){return u(e)?e:[e]}var G=(e,t)=>!Object.is(e,t),H=Function.prototype;function V(e,t){return d(e)?e.indexOf(t)===0:false}function q(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",n=e.length;for(let i=0;i<8;i++)t+=e.charAt(Math.floor(Math.random()*n));return t}function D(){return typeof window!="undefined"&&typeof document!="undefined"}var p=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},$=Object.freeze({}),W=Object.freeze([]),Y=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90,y,I=()=>y||(y=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});function K(e,t){return t?u(t)?t.includes(e):m(t)?t(e):false:false}var X=/\B([A-Z])/g,J=p(e=>e.replaceAll(X,"-$1").toLowerCase()),Z=/[_-](\w)/g,Q=p(e=>(e=e.replaceAll(/^[_-]+|[_-]+$/g,""),e=e.replaceAll(/[_-]+/g,"-"),e.replaceAll(Z,(t,n)=>n.toUpperCase()))),ee=p(e=>e.charAt(0).toUpperCase()+e.slice(1));function te(e,...t){console.warn(`[Essor warn]: ${e}`,...t);}function ne(e,...t){console.info(`[Essor info]: ${e}`,...t);}function g(e,...t){console.error(`[Essor error]: ${e}`,...t);}var oe=/["&'<>]/;function re(e){let t=`${e}`,n=oe.exec(t);if(!n)return t;let i="",s,r,c=0;for(r=n.index;r<t.length;r++){switch(t.charCodeAt(r)){case 34:s=""";break;case 38:s="&";break;case 39:s="'";break;case 60:s="<";break;case 62:s=">";break;default:continue}c!==r&&(i+=t.slice(c,r)),c=r+1,i+=s;}return c!==r?i+t.slice(c,r):i}var ie=/^-?>|<!--|-->|--!>|<!-$/g;function ae(e){return e.replaceAll(ie,"")}var se=/[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;function le(e,t){return e.replaceAll(se,n=>t?n==='"'?'\\\\\\"':`\\\\${n}`:`\\${n}`)}function o(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return n=>n in t}var k="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ce=o(k),pe=o(`${k},async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);function ue(e){return !!e||e===""}var de=/[\t\n\f "'/=>]/,h={};function me(e){if(f(h,e))return h[e];let t=de.test(e);return t&&__DEV__&&g(`unsafe attribute name: ${e}`),h[e]=!t}var fe={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},ge=o("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"),he=o("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 be(e){if(e==null)return false;let t=typeof e;return t==="string"||t==="number"||t==="boolean"}var ye="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",ke="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",xe="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",we="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",Te="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Ae=o(ye),Se=o(ke),Me=o(xe),Ce=o(ve),Ee=o(Te),Ne=o(we);exports.EMPTY_ARR=W;exports.EMPTY_OBJ=$;exports.cacheStringFunction=p;exports.camelCase=Q;exports.capitalize=ee;exports.coerceArray=U;exports.error=g;exports.escapeHTML=re;exports.escapeHTMLComment=ae;exports.extend=B;exports.generateUniqueId=q;exports.getEscapedCssVarName=le;exports.getGlobalThis=I;exports.hasChanged=G;exports.hasOwn=f;exports.includeBooleanAttr=ue;exports.info=ne;exports.isArray=u;exports.isBoolean=_;exports.isBooleanAttr=pe;exports.isBrowser=D;exports.isDelegatedEvent=Ne;exports.isExclude=K;exports.isFalsy=N;exports.isFunction=m;exports.isHTMLElement=j;exports.isHTMLTag=Ae;exports.isKnownHtmlAttr=ge;exports.isKnownSvgAttr=he;exports.isMap=C;exports.isMathMLTag=Me;exports.isNaN=z;exports.isNil=E;exports.isNull=b;exports.isNumber=v;exports.isObject=x;exports.isOn=Y;exports.isPlainObject=L;exports.isPrimitive=O;exports.isPromise=w;exports.isRenderAbleAttrValue=be;exports.isSSRSafeAttrName=me;exports.isSVGTag=Se;exports.isSelfClosingTag=Ee;exports.isSet=A;exports.isSpecialBooleanAttr=ce;exports.isString=d;exports.isStringNumber=P;exports.isSymbol=T;exports.isUndefined=R;exports.isVoidTag=Ce;exports.isWeakMap=S;exports.isWeakSet=M;exports.kebabCase=J;exports.noop=H;exports.propsToAttrMap=fe;exports.startsWith=V;exports.warn=te;//# sourceMappingURL=shared.cjs.js.map
|
|
2
|
+
//# 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"],"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","isBrowser","cacheStringFunction","fn","cache","EMPTY_OBJ","EMPTY_ARR","isOn","_globalThis","getGlobalThis","isExclude","exclude","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"],"mappings":"aAOO,IAAMA,CAAAA,CAAYC,GACvBA,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,EAASJ,CAAAA,CAA6B,CACpD,OAAO,OAAOA,CAAAA,EAAQ,QACxB,CAOO,SAASK,CAAAA,CAASL,CAAAA,CAA6B,CACpD,OAAO,OAAOA,CAAAA,EAAQ,QACxB,CAMO,SAASM,CAAAA,CAAON,EAA2B,CAChD,OAAOA,CAAAA,GAAQ,IACjB,CAOO,SAASO,EAASP,CAAAA,CAA6B,CACpD,OAAO,OAAOA,CAAAA,EAAQ,QACxB,CAOO,SAASQ,EAAMR,CAAAA,CAAmC,CACvD,OAAOE,CAA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","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, isFunction, 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\nexport type ExcludeType = ((key: string | symbol) => boolean) | (string | symbol)[];\n\n/**\n * Checks if a key should be excluded\n * @param {string | symbol} key - The key to check\n * @param {ExcludeType} [exclude] - The exclusion condition, can be a function or array\n * @returns {boolean} - Returns true if the key should be excluded, false otherwise\n */\nexport function isExclude(key: string | symbol, exclude?: ExcludeType): boolean {\n if (!exclude) {\n return false;\n }\n return isArray(exclude) ? exclude.includes(key) : isFunction(exclude) ? exclude(key) : false;\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"]}
|
package/dist/shared.d.cts
CHANGED
|
@@ -1,80 +1,325 @@
|
|
|
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
|
-
|
|
26
|
+
/**
|
|
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
|
|
31
|
+
*/
|
|
32
|
+
declare const hasChanged: (value: unknown, oldValue: unknown) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Empty function, used for defaults and placeholders
|
|
35
|
+
* @type {Function}
|
|
36
|
+
*/
|
|
11
37
|
declare const noop: () => void;
|
|
12
38
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
39
|
+
* Checks if a string starts with a specified substring
|
|
40
|
+
*
|
|
41
|
+
* Uses indexOf for better performance in most cases
|
|
15
42
|
* @see https://www.measurethat.net/Benchmarks/Show/12350/0/startswith-vs-test-vs-match-vs-indexof#latest_results_block
|
|
16
|
-
|
|
17
|
-
* @param {string}
|
|
18
|
-
* @
|
|
19
|
-
|
|
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
|
|
46
|
+
*/
|
|
47
|
+
declare function startsWith(str: string, searchString: string): boolean;
|
|
48
|
+
/**
|
|
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
|
|
54
|
+
*/
|
|
55
|
+
declare function generateUniqueId(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Checks if the current environment is a browser
|
|
58
|
+
* @returns {boolean} - Returns true if in a browser environment, false otherwise
|
|
59
|
+
*/
|
|
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
|
|
20
86
|
*/
|
|
21
|
-
declare
|
|
87
|
+
declare const isOn: (key: string) => boolean;
|
|
22
88
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @
|
|
25
|
-
* @returns The escaped string.
|
|
89
|
+
* Gets the global object for the current environment
|
|
90
|
+
* @returns {unknown } - The global object for the current environment
|
|
26
91
|
*/
|
|
27
|
-
declare
|
|
92
|
+
declare const getGlobalThis: () => unknown;
|
|
28
93
|
type ExcludeType = ((key: string | symbol) => boolean) | (string | symbol)[];
|
|
29
94
|
/**
|
|
30
|
-
* Checks if a key should be excluded
|
|
31
|
-
* @param key - The key to check
|
|
32
|
-
* @param exclude - The exclusion
|
|
33
|
-
* @returns
|
|
95
|
+
* Checks if a key should be excluded
|
|
96
|
+
* @param {string | symbol} key - The key to check
|
|
97
|
+
* @param {ExcludeType} [exclude] - The exclusion condition, can be a function or array
|
|
98
|
+
* @returns {boolean} - Returns true if the key should be excluded, false otherwise
|
|
34
99
|
*/
|
|
35
100
|
declare function isExclude(key: string | symbol, exclude?: ExcludeType): boolean;
|
|
101
|
+
|
|
36
102
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* @returns
|
|
103
|
+
* Checks if a value is an object
|
|
104
|
+
* @param {unknown} val - The value to check
|
|
105
|
+
* @returns {boolean} - Returns true if the value is an object, false otherwise
|
|
40
106
|
*/
|
|
41
|
-
declare
|
|
107
|
+
declare const isObject: (val: unknown) => val is Record<any, unknown>;
|
|
42
108
|
/**
|
|
43
|
-
* Checks if
|
|
44
|
-
* @
|
|
109
|
+
* Checks if a value is a Promise
|
|
110
|
+
* @template T - The type of the Promise's resolved value
|
|
111
|
+
* @param {unknown} val - The value to check
|
|
112
|
+
* @returns {boolean} - Returns true if the value is a Promise, false otherwise
|
|
113
|
+
*/
|
|
114
|
+
declare function isPromise<T = unknown>(val: unknown): val is Promise<T>;
|
|
115
|
+
/**
|
|
116
|
+
* Checks if a value is an Array
|
|
117
|
+
* @type {(arg: unknown ) => arg is unknown []}
|
|
45
118
|
*/
|
|
46
|
-
declare function isBrowser(): boolean;
|
|
47
|
-
|
|
48
|
-
declare const isObject: (val: unknown) => val is Record<any, any>;
|
|
49
|
-
declare function isPromise(val: any): val is Promise<any>;
|
|
50
119
|
declare const isArray: (arg: any) => arg is any[];
|
|
120
|
+
/**
|
|
121
|
+
* Checks if a value is a string
|
|
122
|
+
* @param {unknown} val - The value to check
|
|
123
|
+
* @returns {boolean} - Returns true if the value is a string, false otherwise
|
|
124
|
+
*/
|
|
51
125
|
declare function isString(val: unknown): val is string;
|
|
126
|
+
/**
|
|
127
|
+
* Checks if a value is a number
|
|
128
|
+
* @param {unknown} val - The value to check
|
|
129
|
+
* @returns {boolean} - Returns true if the value is a number, false otherwise
|
|
130
|
+
*/
|
|
131
|
+
declare function isNumber(val: unknown): val is number;
|
|
132
|
+
/**
|
|
133
|
+
* Checks if a value is null
|
|
134
|
+
* @param {unknown} val - The value to check
|
|
135
|
+
* @returns {boolean} - Returns true if the value is null, false otherwise
|
|
136
|
+
*/
|
|
137
|
+
declare function isNull(val: unknown): val is null;
|
|
138
|
+
/**
|
|
139
|
+
* Checks if a value is a Symbol
|
|
140
|
+
* @param {unknown} val - The value to check
|
|
141
|
+
* @returns {boolean} - Returns true if the value is a Symbol, false otherwise
|
|
142
|
+
*/
|
|
52
143
|
declare function isSymbol(val: unknown): val is symbol;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Checks if a value is a Set
|
|
146
|
+
* @param {unknown} val - The value to check
|
|
147
|
+
* @returns {boolean} - Returns true if the value is a Set, false otherwise
|
|
148
|
+
*/
|
|
149
|
+
declare function isSet(val: unknown): val is Set<unknown>;
|
|
150
|
+
/**
|
|
151
|
+
* Checks if a value is a WeakMap
|
|
152
|
+
* @param {unknown} val - The value to check
|
|
153
|
+
* @returns {boolean} - Returns true if the value is a WeakMap, false otherwise
|
|
154
|
+
*/
|
|
155
|
+
declare function isWeakMap(val: unknown): val is WeakMap<any, unknown>;
|
|
156
|
+
/**
|
|
157
|
+
* Checks if a value is a WeakSet
|
|
158
|
+
* @param {unknown} val - The value to check
|
|
159
|
+
* @returns {boolean} - Returns true if the value is a WeakSet, false otherwise
|
|
160
|
+
*/
|
|
161
|
+
declare function isWeakSet(val: unknown): val is WeakSet<any>;
|
|
162
|
+
/**
|
|
163
|
+
* Checks if a value is a Map
|
|
164
|
+
* @param {unknown} val - The value to check
|
|
165
|
+
* @returns {boolean} - Returns true if the value is a Map, false otherwise
|
|
166
|
+
*/
|
|
167
|
+
declare function isMap(val: unknown): val is Map<unknown, unknown>;
|
|
168
|
+
/**
|
|
169
|
+
* Checks if a value is null or undefined
|
|
170
|
+
* @param {unknown} val - The value to check
|
|
171
|
+
* @returns {boolean} - Returns true if the value is null or undefined, false otherwise
|
|
172
|
+
*/
|
|
173
|
+
declare function isNil(val: unknown): val is null | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Checks if a value is a function
|
|
176
|
+
* @param {unknown} val - The value to check
|
|
177
|
+
* @returns {boolean} - Returns true if the value is a function, false otherwise
|
|
178
|
+
*/
|
|
58
179
|
declare const isFunction: (val: unknown) => val is Function;
|
|
59
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Checks if a value is falsy (false, null, or undefined)
|
|
182
|
+
* @param {unknown} val - The value to check
|
|
183
|
+
* @returns {boolean} - Returns true if the value is falsy, false otherwise
|
|
184
|
+
*/
|
|
185
|
+
declare function isFalsy(val: unknown): val is false | null | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* Checks if a value is a primitive type (string, number, boolean, symbol, null, or undefined)
|
|
188
|
+
* @param {unknown} val - The value to check
|
|
189
|
+
* @returns {boolean} - Returns true if the value is a primitive type, false otherwise
|
|
190
|
+
*/
|
|
60
191
|
declare const isPrimitive: (val: unknown) => val is string | number | boolean | symbol | null | undefined;
|
|
61
|
-
|
|
192
|
+
/**
|
|
193
|
+
* Checks if a value is an HTMLElement
|
|
194
|
+
* @param {unknown} val - The value to check
|
|
195
|
+
* @returns {boolean} - Returns true if the value is an HTMLElement, false otherwise
|
|
196
|
+
*/
|
|
197
|
+
declare function isHTMLElement(val: unknown): val is HTMLElement;
|
|
198
|
+
/**
|
|
199
|
+
* Checks if a value is a plain object (created using Object constructor)
|
|
200
|
+
* @param {unknown} val - The value to check
|
|
201
|
+
* @returns {boolean} - Returns true if the value is a plain object, false otherwise
|
|
202
|
+
*/
|
|
62
203
|
declare const isPlainObject: (val: unknown) => val is object;
|
|
204
|
+
/**
|
|
205
|
+
* String representation of a number
|
|
206
|
+
* @typedef {`${number}`} StringNumber
|
|
207
|
+
*/
|
|
63
208
|
type StringNumber = `${number}`;
|
|
209
|
+
/**
|
|
210
|
+
* Checks if a value is a string representation of a number
|
|
211
|
+
* @param {unknown} val - The value to check
|
|
212
|
+
* @returns {boolean} - Returns true if the value is a string number, false otherwise
|
|
213
|
+
*/
|
|
64
214
|
declare function isStringNumber(val: unknown): val is StringNumber;
|
|
215
|
+
/**
|
|
216
|
+
* Checks if a value is undefined
|
|
217
|
+
* @param {unknown} val - The value to check
|
|
218
|
+
* @returns {boolean} - Returns true if the value is undefined, false otherwise
|
|
219
|
+
*/
|
|
220
|
+
declare function isUndefined(val: unknown): val is undefined;
|
|
221
|
+
/**
|
|
222
|
+
* Checks if a value is a boolean
|
|
223
|
+
* @param {unknown} val - The value to check
|
|
224
|
+
* @returns {boolean} - Returns true if the value is a boolean, false otherwise
|
|
225
|
+
*/
|
|
226
|
+
declare function isBoolean(val: unknown): val is boolean;
|
|
227
|
+
declare function isNaN(val: unknown): val is number;
|
|
65
228
|
|
|
229
|
+
/**
|
|
230
|
+
* Converts a camelCase string to kebab-case
|
|
231
|
+
* Example: myFunction -> my-function
|
|
232
|
+
* @param {string} str - The camelCase string to convert
|
|
233
|
+
* @returns {string} - The kebab-case string
|
|
234
|
+
*/
|
|
66
235
|
declare const kebabCase: (str: string) => string;
|
|
236
|
+
/**
|
|
237
|
+
* Converts a kebab-case or snake_case string to camelCase
|
|
238
|
+
* Example: my-function or my_function -> myFunction
|
|
239
|
+
* @param {string} str - The kebab-case or snake_case string to convert
|
|
240
|
+
* @returns {string} - The camelCase string
|
|
241
|
+
*/
|
|
67
242
|
declare const camelCase: (str: string) => string;
|
|
68
243
|
/**
|
|
69
|
-
* Capitalizes the first letter of a string
|
|
70
|
-
*
|
|
71
|
-
* @
|
|
72
|
-
* @
|
|
244
|
+
* Capitalizes the first letter of a string
|
|
245
|
+
* Example: hello -> Hello
|
|
246
|
+
* @template T - The input string type
|
|
247
|
+
* @param {T} str - The string to capitalize
|
|
248
|
+
* @returns {Capitalize<T>} - The capitalized string
|
|
73
249
|
*/
|
|
74
250
|
declare const capitalize: <T extends string>(str: T) => Capitalize<T>;
|
|
75
251
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
252
|
+
/**
|
|
253
|
+
* Outputs a warning level log message
|
|
254
|
+
* @param {string} msg - The warning message
|
|
255
|
+
* @param {...unknown } args - Additional arguments to log
|
|
256
|
+
*/
|
|
257
|
+
declare function warn(msg: string, ...args: unknown[]): void;
|
|
258
|
+
/**
|
|
259
|
+
* Outputs an info level log message
|
|
260
|
+
* @param {string} msg - The info message
|
|
261
|
+
* @param {...unknown } args - Additional arguments to log
|
|
262
|
+
*/
|
|
263
|
+
declare function info(msg: string, ...args: unknown[]): void;
|
|
264
|
+
/**
|
|
265
|
+
* Outputs an error level log message
|
|
266
|
+
* @param {string} msg - The error message
|
|
267
|
+
* @param {...unknown } args - Additional arguments to log
|
|
268
|
+
*/
|
|
269
|
+
declare function error(msg: string, ...args: unknown[]): void;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Escapes HTML special characters in a string to their corresponding entity references
|
|
273
|
+
* @param {unknown} string - The string to escapeHTML
|
|
274
|
+
* @returns {string} - The escaped string
|
|
275
|
+
*/
|
|
276
|
+
declare function escapeHTML(string: unknown): string;
|
|
277
|
+
/**
|
|
278
|
+
* Strips special characters from HTML comments
|
|
279
|
+
* @param {string} src - The source string
|
|
280
|
+
* @returns {string} - The cleaned string
|
|
281
|
+
*/
|
|
282
|
+
declare function escapeHTMLComment(src: string): string;
|
|
283
|
+
/**
|
|
284
|
+
* Escapes special characters in CSS variable names
|
|
285
|
+
* @param {string} key - The CSS variable name
|
|
286
|
+
* @param {boolean} doubleEscape - Whether to apply double escaping
|
|
287
|
+
* @returns {string} - The escaped CSS variable name
|
|
288
|
+
*/
|
|
289
|
+
declare function getEscapedCssVarName(key: string, doubleEscape: boolean): string;
|
|
290
|
+
|
|
291
|
+
declare const isSpecialBooleanAttr: (key: string) => boolean;
|
|
292
|
+
/**
|
|
293
|
+
* The full list is needed during SSR to produce the correct initial markup.
|
|
294
|
+
*/
|
|
295
|
+
declare const isBooleanAttr: (key: string) => boolean;
|
|
296
|
+
/**
|
|
297
|
+
* Boolean attributes should be included if the value is truthy or ''.
|
|
298
|
+
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
299
|
+
*/
|
|
300
|
+
declare function includeBooleanAttr(value: unknown): boolean;
|
|
301
|
+
declare function isSSRSafeAttrName(name: string): boolean;
|
|
302
|
+
declare const propsToAttrMap: Record<string, string | undefined>;
|
|
303
|
+
/**
|
|
304
|
+
* Known attributes, this is used for stringification of runtime static nodes
|
|
305
|
+
* so that we don't stringify bindings that cannot be set from HTML.
|
|
306
|
+
* Don't also forget to allow `data-*` and `aria-*`!
|
|
307
|
+
* Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
|
|
308
|
+
*/
|
|
309
|
+
declare const isKnownHtmlAttr: (key: string) => boolean;
|
|
310
|
+
/**
|
|
311
|
+
* Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
|
|
312
|
+
*/
|
|
313
|
+
declare const isKnownSvgAttr: (key: string) => boolean;
|
|
314
|
+
/**
|
|
315
|
+
* Shared between server-renderer and runtime-core hydration logic
|
|
316
|
+
*/
|
|
317
|
+
declare function isRenderAbleAttrValue(value: unknown): boolean;
|
|
318
|
+
declare const isHTMLTag: (key: string) => boolean;
|
|
319
|
+
declare const isSVGTag: (key: string) => boolean;
|
|
320
|
+
declare const isMathMLTag: (key: string) => boolean;
|
|
321
|
+
declare const isVoidTag: (key: string) => boolean;
|
|
322
|
+
declare const isSelfClosingTag: (key: string) => boolean;
|
|
323
|
+
declare const isDelegatedEvent: (key: string) => boolean;
|
|
79
324
|
|
|
80
|
-
export { type ExcludeType, type StringNumber,
|
|
325
|
+
export { EMPTY_ARR, EMPTY_OBJ, type ExcludeType, type StringNumber, cacheStringFunction, camelCase, capitalize, coerceArray, error, escapeHTML, escapeHTMLComment, extend, generateUniqueId, getEscapedCssVarName, getGlobalThis, hasChanged, hasOwn, includeBooleanAttr, info, isArray, isBoolean, isBooleanAttr, isBrowser, isDelegatedEvent, isExclude, isFalsy, isFunction, isHTMLElement, isHTMLTag, isKnownHtmlAttr, isKnownSvgAttr, isMap, isMathMLTag, isNaN, isNil, isNull, isNumber, isObject, isOn, isPlainObject, isPrimitive, isPromise, isRenderAbleAttrValue, isSSRSafeAttrName, isSVGTag, isSelfClosingTag, isSet, isSpecialBooleanAttr, isString, isStringNumber, isSymbol, isUndefined, isVoidTag, isWeakMap, isWeakSet, kebabCase, noop, propsToAttrMap, startsWith, warn };
|