source: node_modules/@vue/shared/dist/shared.esm-bundler.js@ a70b5a4

Last change on this file since a70b5a4 was 57e58a3, checked in by ste08 <sjovanoska@…>, 4 months ago

Initial commit

  • Property mode set to 100644
File size: 22.0 KB
Line 
1/**
2* @vue/shared v3.5.13
3* (c) 2018-present Yuxi (Evan) You and Vue contributors
4* @license MIT
5**/
6/*! #__NO_SIDE_EFFECTS__ */
7// @__NO_SIDE_EFFECTS__
8function makeMap(str) {
9 const map = /* @__PURE__ */ Object.create(null);
10 for (const key of str.split(",")) map[key] = 1;
11 return (val) => val in map;
12}
13
14const EMPTY_OBJ = !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
15const EMPTY_ARR = !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
16const NOOP = () => {
17};
18const NO = () => false;
19const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
20(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
21const isModelListener = (key) => key.startsWith("onUpdate:");
22const extend = Object.assign;
23const remove = (arr, el) => {
24 const i = arr.indexOf(el);
25 if (i > -1) {
26 arr.splice(i, 1);
27 }
28};
29const hasOwnProperty = Object.prototype.hasOwnProperty;
30const hasOwn = (val, key) => hasOwnProperty.call(val, key);
31const isArray = Array.isArray;
32const isMap = (val) => toTypeString(val) === "[object Map]";
33const isSet = (val) => toTypeString(val) === "[object Set]";
34const isDate = (val) => toTypeString(val) === "[object Date]";
35const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
36const isFunction = (val) => typeof val === "function";
37const isString = (val) => typeof val === "string";
38const isSymbol = (val) => typeof val === "symbol";
39const isObject = (val) => val !== null && typeof val === "object";
40const isPromise = (val) => {
41 return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
42};
43const objectToString = Object.prototype.toString;
44const toTypeString = (value) => objectToString.call(value);
45const toRawType = (value) => {
46 return toTypeString(value).slice(8, -1);
47};
48const isPlainObject = (val) => toTypeString(val) === "[object Object]";
49const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
50const isReservedProp = /* @__PURE__ */ makeMap(
51 // the leading comma is intentional so empty string "" is also included
52 ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
53);
54const isBuiltInDirective = /* @__PURE__ */ makeMap(
55 "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
56);
57const cacheStringFunction = (fn) => {
58 const cache = /* @__PURE__ */ Object.create(null);
59 return (str) => {
60 const hit = cache[str];
61 return hit || (cache[str] = fn(str));
62 };
63};
64const camelizeRE = /-(\w)/g;
65const camelize = cacheStringFunction(
66 (str) => {
67 return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
68 }
69);
70const hyphenateRE = /\B([A-Z])/g;
71const hyphenate = cacheStringFunction(
72 (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
73);
74const capitalize = cacheStringFunction((str) => {
75 return str.charAt(0).toUpperCase() + str.slice(1);
76});
77const toHandlerKey = cacheStringFunction(
78 (str) => {
79 const s = str ? `on${capitalize(str)}` : ``;
80 return s;
81 }
82);
83const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
84const invokeArrayFns = (fns, ...arg) => {
85 for (let i = 0; i < fns.length; i++) {
86 fns[i](...arg);
87 }
88};
89const def = (obj, key, value, writable = false) => {
90 Object.defineProperty(obj, key, {
91 configurable: true,
92 enumerable: false,
93 writable,
94 value
95 });
96};
97const looseToNumber = (val) => {
98 const n = parseFloat(val);
99 return isNaN(n) ? val : n;
100};
101const toNumber = (val) => {
102 const n = isString(val) ? Number(val) : NaN;
103 return isNaN(n) ? val : n;
104};
105let _globalThis;
106const getGlobalThis = () => {
107 return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
108};
109const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
110function genPropsAccessExp(name) {
111 return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
112}
113function genCacheKey(source, options) {
114 return source + JSON.stringify(
115 options,
116 (_, val) => typeof val === "function" ? val.toString() : val
117 );
118}
119
120const PatchFlags = {
121 "TEXT": 1,
122 "1": "TEXT",
123 "CLASS": 2,
124 "2": "CLASS",
125 "STYLE": 4,
126 "4": "STYLE",
127 "PROPS": 8,
128 "8": "PROPS",
129 "FULL_PROPS": 16,
130 "16": "FULL_PROPS",
131 "NEED_HYDRATION": 32,
132 "32": "NEED_HYDRATION",
133 "STABLE_FRAGMENT": 64,
134 "64": "STABLE_FRAGMENT",
135 "KEYED_FRAGMENT": 128,
136 "128": "KEYED_FRAGMENT",
137 "UNKEYED_FRAGMENT": 256,
138 "256": "UNKEYED_FRAGMENT",
139 "NEED_PATCH": 512,
140 "512": "NEED_PATCH",
141 "DYNAMIC_SLOTS": 1024,
142 "1024": "DYNAMIC_SLOTS",
143 "DEV_ROOT_FRAGMENT": 2048,
144 "2048": "DEV_ROOT_FRAGMENT",
145 "CACHED": -1,
146 "-1": "CACHED",
147 "BAIL": -2,
148 "-2": "BAIL"
149};
150const PatchFlagNames = {
151 [1]: `TEXT`,
152 [2]: `CLASS`,
153 [4]: `STYLE`,
154 [8]: `PROPS`,
155 [16]: `FULL_PROPS`,
156 [32]: `NEED_HYDRATION`,
157 [64]: `STABLE_FRAGMENT`,
158 [128]: `KEYED_FRAGMENT`,
159 [256]: `UNKEYED_FRAGMENT`,
160 [512]: `NEED_PATCH`,
161 [1024]: `DYNAMIC_SLOTS`,
162 [2048]: `DEV_ROOT_FRAGMENT`,
163 [-1]: `HOISTED`,
164 [-2]: `BAIL`
165};
166
167const ShapeFlags = {
168 "ELEMENT": 1,
169 "1": "ELEMENT",
170 "FUNCTIONAL_COMPONENT": 2,
171 "2": "FUNCTIONAL_COMPONENT",
172 "STATEFUL_COMPONENT": 4,
173 "4": "STATEFUL_COMPONENT",
174 "TEXT_CHILDREN": 8,
175 "8": "TEXT_CHILDREN",
176 "ARRAY_CHILDREN": 16,
177 "16": "ARRAY_CHILDREN",
178 "SLOTS_CHILDREN": 32,
179 "32": "SLOTS_CHILDREN",
180 "TELEPORT": 64,
181 "64": "TELEPORT",
182 "SUSPENSE": 128,
183 "128": "SUSPENSE",
184 "COMPONENT_SHOULD_KEEP_ALIVE": 256,
185 "256": "COMPONENT_SHOULD_KEEP_ALIVE",
186 "COMPONENT_KEPT_ALIVE": 512,
187 "512": "COMPONENT_KEPT_ALIVE",
188 "COMPONENT": 6,
189 "6": "COMPONENT"
190};
191
192const SlotFlags = {
193 "STABLE": 1,
194 "1": "STABLE",
195 "DYNAMIC": 2,
196 "2": "DYNAMIC",
197 "FORWARDED": 3,
198 "3": "FORWARDED"
199};
200const slotFlagsText = {
201 [1]: "STABLE",
202 [2]: "DYNAMIC",
203 [3]: "FORWARDED"
204};
205
206const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol";
207const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
208const isGloballyWhitelisted = isGloballyAllowed;
209
210const range = 2;
211function generateCodeFrame(source, start = 0, end = source.length) {
212 start = Math.max(0, Math.min(start, source.length));
213 end = Math.max(0, Math.min(end, source.length));
214 if (start > end) return "";
215 let lines = source.split(/(\r?\n)/);
216 const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
217 lines = lines.filter((_, idx) => idx % 2 === 0);
218 let count = 0;
219 const res = [];
220 for (let i = 0; i < lines.length; i++) {
221 count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);
222 if (count >= start) {
223 for (let j = i - range; j <= i + range || end > count; j++) {
224 if (j < 0 || j >= lines.length) continue;
225 const line = j + 1;
226 res.push(
227 `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`
228 );
229 const lineLength = lines[j].length;
230 const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
231 if (j === i) {
232 const pad = start - (count - (lineLength + newLineSeqLength));
233 const length = Math.max(
234 1,
235 end > count ? lineLength - pad : end - start
236 );
237 res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
238 } else if (j > i) {
239 if (end > count) {
240 const length = Math.max(Math.min(end - count, lineLength), 1);
241 res.push(` | ` + "^".repeat(length));
242 }
243 count += lineLength + newLineSeqLength;
244 }
245 }
246 break;
247 }
248 }
249 return res.join("\n");
250}
251
252function normalizeStyle(value) {
253 if (isArray(value)) {
254 const res = {};
255 for (let i = 0; i < value.length; i++) {
256 const item = value[i];
257 const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
258 if (normalized) {
259 for (const key in normalized) {
260 res[key] = normalized[key];
261 }
262 }
263 }
264 return res;
265 } else if (isString(value) || isObject(value)) {
266 return value;
267 }
268}
269const listDelimiterRE = /;(?![^(]*\))/g;
270const propertyDelimiterRE = /:([^]+)/;
271const styleCommentRE = /\/\*[^]*?\*\//g;
272function parseStringStyle(cssText) {
273 const ret = {};
274 cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
275 if (item) {
276 const tmp = item.split(propertyDelimiterRE);
277 tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
278 }
279 });
280 return ret;
281}
282function stringifyStyle(styles) {
283 if (!styles) return "";
284 if (isString(styles)) return styles;
285 let ret = "";
286 for (const key in styles) {
287 const value = styles[key];
288 if (isString(value) || typeof value === "number") {
289 const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
290 ret += `${normalizedKey}:${value};`;
291 }
292 }
293 return ret;
294}
295function normalizeClass(value) {
296 let res = "";
297 if (isString(value)) {
298 res = value;
299 } else if (isArray(value)) {
300 for (let i = 0; i < value.length; i++) {
301 const normalized = normalizeClass(value[i]);
302 if (normalized) {
303 res += normalized + " ";
304 }
305 }
306 } else if (isObject(value)) {
307 for (const name in value) {
308 if (value[name]) {
309 res += name + " ";
310 }
311 }
312 }
313 return res.trim();
314}
315function normalizeProps(props) {
316 if (!props) return null;
317 let { class: klass, style } = props;
318 if (klass && !isString(klass)) {
319 props.class = normalizeClass(klass);
320 }
321 if (style) {
322 props.style = normalizeStyle(style);
323 }
324 return props;
325}
326
327const HTML_TAGS = "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";
328const SVG_TAGS = "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";
329const MATH_TAGS = "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";
330const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
331const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
332const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
333const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
334const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
335
336const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
337const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
338const isBooleanAttr = /* @__PURE__ */ makeMap(
339 specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
340);
341function includeBooleanAttr(value) {
342 return !!value || value === "";
343}
344const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
345const attrValidationCache = {};
346function isSSRSafeAttrName(name) {
347 if (attrValidationCache.hasOwnProperty(name)) {
348 return attrValidationCache[name];
349 }
350 const isUnsafe = unsafeAttrCharRE.test(name);
351 if (isUnsafe) {
352 console.error(`unsafe attribute name: ${name}`);
353 }
354 return attrValidationCache[name] = !isUnsafe;
355}
356const propsToAttrMap = {
357 acceptCharset: "accept-charset",
358 className: "class",
359 htmlFor: "for",
360 httpEquiv: "http-equiv"
361};
362const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
363 `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`
364);
365const isKnownSvgAttr = /* @__PURE__ */ makeMap(
366 `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`
367);
368const isKnownMathMLAttr = /* @__PURE__ */ makeMap(
369 `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns`
370);
371function isRenderableAttrValue(value) {
372 if (value == null) {
373 return false;
374 }
375 const type = typeof value;
376 return type === "string" || type === "number" || type === "boolean";
377}
378
379const escapeRE = /["'&<>]/;
380function escapeHtml(string) {
381 const str = "" + string;
382 const match = escapeRE.exec(str);
383 if (!match) {
384 return str;
385 }
386 let html = "";
387 let escaped;
388 let index;
389 let lastIndex = 0;
390 for (index = match.index; index < str.length; index++) {
391 switch (str.charCodeAt(index)) {
392 case 34:
393 escaped = "&quot;";
394 break;
395 case 38:
396 escaped = "&amp;";
397 break;
398 case 39:
399 escaped = "&#39;";
400 break;
401 case 60:
402 escaped = "&lt;";
403 break;
404 case 62:
405 escaped = "&gt;";
406 break;
407 default:
408 continue;
409 }
410 if (lastIndex !== index) {
411 html += str.slice(lastIndex, index);
412 }
413 lastIndex = index + 1;
414 html += escaped;
415 }
416 return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
417}
418const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
419function escapeHtmlComment(src) {
420 return src.replace(commentStripRE, "");
421}
422const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
423function getEscapedCssVarName(key, doubleEscape) {
424 return key.replace(
425 cssVarNameEscapeSymbolsRE,
426 (s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}`
427 );
428}
429
430function looseCompareArrays(a, b) {
431 if (a.length !== b.length) return false;
432 let equal = true;
433 for (let i = 0; equal && i < a.length; i++) {
434 equal = looseEqual(a[i], b[i]);
435 }
436 return equal;
437}
438function looseEqual(a, b) {
439 if (a === b) return true;
440 let aValidType = isDate(a);
441 let bValidType = isDate(b);
442 if (aValidType || bValidType) {
443 return aValidType && bValidType ? a.getTime() === b.getTime() : false;
444 }
445 aValidType = isSymbol(a);
446 bValidType = isSymbol(b);
447 if (aValidType || bValidType) {
448 return a === b;
449 }
450 aValidType = isArray(a);
451 bValidType = isArray(b);
452 if (aValidType || bValidType) {
453 return aValidType && bValidType ? looseCompareArrays(a, b) : false;
454 }
455 aValidType = isObject(a);
456 bValidType = isObject(b);
457 if (aValidType || bValidType) {
458 if (!aValidType || !bValidType) {
459 return false;
460 }
461 const aKeysCount = Object.keys(a).length;
462 const bKeysCount = Object.keys(b).length;
463 if (aKeysCount !== bKeysCount) {
464 return false;
465 }
466 for (const key in a) {
467 const aHasKey = a.hasOwnProperty(key);
468 const bHasKey = b.hasOwnProperty(key);
469 if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
470 return false;
471 }
472 }
473 }
474 return String(a) === String(b);
475}
476function looseIndexOf(arr, val) {
477 return arr.findIndex((item) => looseEqual(item, val));
478}
479
480const isRef = (val) => {
481 return !!(val && val["__v_isRef"] === true);
482};
483const toDisplayString = (val) => {
484 return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
485};
486const replacer = (_key, val) => {
487 if (isRef(val)) {
488 return replacer(_key, val.value);
489 } else if (isMap(val)) {
490 return {
491 [`Map(${val.size})`]: [...val.entries()].reduce(
492 (entries, [key, val2], i) => {
493 entries[stringifySymbol(key, i) + " =>"] = val2;
494 return entries;
495 },
496 {}
497 )
498 };
499 } else if (isSet(val)) {
500 return {
501 [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
502 };
503 } else if (isSymbol(val)) {
504 return stringifySymbol(val);
505 } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
506 return String(val);
507 }
508 return val;
509};
510const stringifySymbol = (v, i = "") => {
511 var _a;
512 return (
513 // Symbol.description in es2019+ so we need to cast here to pass
514 // the lib: es2016 check
515 isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
516 );
517};
518
519export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, camelize, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownMathMLAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isObject, isOn, isPlainObject, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };
Note: See TracBrowser for help on using the repository browser.