@vue/shared 3.3.9 → 3.3.11

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.
@@ -16,8 +16,8 @@ const EMPTY_ARR = Object.freeze([]) ;
16
16
  const NOOP = () => {
17
17
  };
18
18
  const NO = () => false;
19
- const onRE = /^on[^a-z]/;
20
- const isOn = (key) => onRE.test(key);
19
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
20
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
21
21
  const isModelListener = (key) => key.startsWith("onUpdate:");
22
22
  const extend = Object.assign;
23
23
  const remove = (arr, el) => {
@@ -394,20 +394,29 @@ const replacer = (_key, val) => {
394
394
  return replacer(_key, val.value);
395
395
  } else if (isMap(val)) {
396
396
  return {
397
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
398
- entries[`${key} =>`] = val2;
399
- return entries;
400
- }, {})
397
+ [`Map(${val.size})`]: [...val.entries()].reduce(
398
+ (entries, [key, val2], i) => {
399
+ entries[stringifySymbol(key, i) + " =>"] = val2;
400
+ return entries;
401
+ },
402
+ {}
403
+ )
401
404
  };
402
405
  } else if (isSet(val)) {
403
406
  return {
404
- [`Set(${val.size})`]: [...val.values()]
407
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
405
408
  };
409
+ } else if (isSymbol(val)) {
410
+ return stringifySymbol(val);
406
411
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
407
412
  return String(val);
408
413
  }
409
414
  return val;
410
415
  };
416
+ const stringifySymbol = (v, i = "") => {
417
+ var _a;
418
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
419
+ };
411
420
 
412
421
  exports.EMPTY_ARR = EMPTY_ARR;
413
422
  exports.EMPTY_OBJ = EMPTY_OBJ;
@@ -16,8 +16,8 @@ const EMPTY_ARR = [];
16
16
  const NOOP = () => {
17
17
  };
18
18
  const NO = () => false;
19
- const onRE = /^on[^a-z]/;
20
- const isOn = (key) => onRE.test(key);
19
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
20
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
21
21
  const isModelListener = (key) => key.startsWith("onUpdate:");
22
22
  const extend = Object.assign;
23
23
  const remove = (arr, el) => {
@@ -394,20 +394,29 @@ const replacer = (_key, val) => {
394
394
  return replacer(_key, val.value);
395
395
  } else if (isMap(val)) {
396
396
  return {
397
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
398
- entries[`${key} =>`] = val2;
399
- return entries;
400
- }, {})
397
+ [`Map(${val.size})`]: [...val.entries()].reduce(
398
+ (entries, [key, val2], i) => {
399
+ entries[stringifySymbol(key, i) + " =>"] = val2;
400
+ return entries;
401
+ },
402
+ {}
403
+ )
401
404
  };
402
405
  } else if (isSet(val)) {
403
406
  return {
404
- [`Set(${val.size})`]: [...val.values()]
407
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
405
408
  };
409
+ } else if (isSymbol(val)) {
410
+ return stringifySymbol(val);
406
411
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
407
412
  return String(val);
408
413
  }
409
414
  return val;
410
415
  };
416
+ const stringifySymbol = (v, i = "") => {
417
+ var _a;
418
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
419
+ };
411
420
 
412
421
  exports.EMPTY_ARR = EMPTY_ARR;
413
422
  exports.EMPTY_OBJ = EMPTY_OBJ;
@@ -12,8 +12,8 @@ const EMPTY_ARR = !!(process.env.NODE_ENV !== "production") ? Object.freeze([])
12
12
  const NOOP = () => {
13
13
  };
14
14
  const NO = () => false;
15
- const onRE = /^on[^a-z]/;
16
- const isOn = (key) => onRE.test(key);
15
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
16
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
17
17
  const isModelListener = (key) => key.startsWith("onUpdate:");
18
18
  const extend = Object.assign;
19
19
  const remove = (arr, el) => {
@@ -390,19 +390,28 @@ const replacer = (_key, val) => {
390
390
  return replacer(_key, val.value);
391
391
  } else if (isMap(val)) {
392
392
  return {
393
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
394
- entries[`${key} =>`] = val2;
395
- return entries;
396
- }, {})
393
+ [`Map(${val.size})`]: [...val.entries()].reduce(
394
+ (entries, [key, val2], i) => {
395
+ entries[stringifySymbol(key, i) + " =>"] = val2;
396
+ return entries;
397
+ },
398
+ {}
399
+ )
397
400
  };
398
401
  } else if (isSet(val)) {
399
402
  return {
400
- [`Set(${val.size})`]: [...val.values()]
403
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
401
404
  };
405
+ } else if (isSymbol(val)) {
406
+ return stringifySymbol(val);
402
407
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
403
408
  return String(val);
404
409
  }
405
410
  return val;
406
411
  };
412
+ const stringifySymbol = (v, i = "") => {
413
+ var _a;
414
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
415
+ };
407
416
 
408
417
  export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, camelize, capitalize, def, escapeHtml, escapeHtmlComment, extend, genPropsAccessExp, generateCodeFrame, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownSvgAttr, isMap, isModelListener, isObject, isOn, isPlainObject, isPromise, isRegExp, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/shared",
3
- "version": "3.3.9",
3
+ "version": "3.3.11",
4
4
  "description": "internal utils shared across @vue packages",
5
5
  "main": "index.js",
6
6
  "module": "dist/shared.esm-bundler.js",