@vue/shared 3.2.29 → 3.2.30

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.
@@ -442,13 +442,15 @@ function looseIndexOf(arr, val) {
442
442
  * @private
443
443
  */
444
444
  const toDisplayString = (val) => {
445
- return val == null
446
- ? ''
447
- : isArray(val) ||
448
- (isObject(val) &&
449
- (val.toString === objectToString || !isFunction(val.toString)))
450
- ? JSON.stringify(val, replacer, 2)
451
- : String(val);
445
+ return isString(val)
446
+ ? val
447
+ : val == null
448
+ ? ''
449
+ : isArray(val) ||
450
+ (isObject(val) &&
451
+ (val.toString === objectToString || !isFunction(val.toString)))
452
+ ? JSON.stringify(val, replacer, 2)
453
+ : String(val);
452
454
  };
453
455
  const replacer = (_key, val) => {
454
456
  // can't use isRef here since @vue/shared has no deps
@@ -522,6 +524,7 @@ const isReservedProp = /*#__PURE__*/ makeMap(
522
524
  'onVnodeBeforeMount,onVnodeMounted,' +
523
525
  'onVnodeBeforeUpdate,onVnodeUpdated,' +
524
526
  'onVnodeBeforeUnmount,onVnodeUnmounted');
527
+ const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
525
528
  const cacheStringFunction = (fn) => {
526
529
  const cache = Object.create(null);
527
530
  return ((str) => {
@@ -602,6 +605,7 @@ exports.includeBooleanAttr = includeBooleanAttr;
602
605
  exports.invokeArrayFns = invokeArrayFns;
603
606
  exports.isArray = isArray;
604
607
  exports.isBooleanAttr = isBooleanAttr;
608
+ exports.isBuiltInDirective = isBuiltInDirective;
605
609
  exports.isDate = isDate;
606
610
  exports.isFunction = isFunction;
607
611
  exports.isGloballyWhitelisted = isGloballyWhitelisted;
@@ -442,13 +442,15 @@ function looseIndexOf(arr, val) {
442
442
  * @private
443
443
  */
444
444
  const toDisplayString = (val) => {
445
- return val == null
446
- ? ''
447
- : isArray(val) ||
448
- (isObject(val) &&
449
- (val.toString === objectToString || !isFunction(val.toString)))
450
- ? JSON.stringify(val, replacer, 2)
451
- : String(val);
445
+ return isString(val)
446
+ ? val
447
+ : val == null
448
+ ? ''
449
+ : isArray(val) ||
450
+ (isObject(val) &&
451
+ (val.toString === objectToString || !isFunction(val.toString)))
452
+ ? JSON.stringify(val, replacer, 2)
453
+ : String(val);
452
454
  };
453
455
  const replacer = (_key, val) => {
454
456
  // can't use isRef here since @vue/shared has no deps
@@ -521,6 +523,7 @@ const isReservedProp = /*#__PURE__*/ makeMap(
521
523
  'onVnodeBeforeMount,onVnodeMounted,' +
522
524
  'onVnodeBeforeUpdate,onVnodeUpdated,' +
523
525
  'onVnodeBeforeUnmount,onVnodeUnmounted');
526
+ const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
524
527
  const cacheStringFunction = (fn) => {
525
528
  const cache = Object.create(null);
526
529
  return ((str) => {
@@ -601,6 +604,7 @@ exports.includeBooleanAttr = includeBooleanAttr;
601
604
  exports.invokeArrayFns = invokeArrayFns;
602
605
  exports.isArray = isArray;
603
606
  exports.isBooleanAttr = isBooleanAttr;
607
+ exports.isBuiltInDirective = isBuiltInDirective;
604
608
  exports.isDate = isDate;
605
609
  exports.isFunction = isFunction;
606
610
  exports.isGloballyWhitelisted = isGloballyWhitelisted;
package/dist/shared.d.ts CHANGED
@@ -57,6 +57,8 @@ export declare const isArray: (arg: any) => arg is any[];
57
57
  */
58
58
  export declare const isBooleanAttr: (key: string) => boolean;
59
59
 
60
+ export declare const isBuiltInDirective: (key: string) => boolean;
61
+
60
62
  export declare const isDate: (val: unknown) => val is Date;
61
63
 
62
64
  export declare const isFunction: (val: unknown) => val is Function;
@@ -438,13 +438,15 @@ function looseIndexOf(arr, val) {
438
438
  * @private
439
439
  */
440
440
  const toDisplayString = (val) => {
441
- return val == null
442
- ? ''
443
- : isArray(val) ||
444
- (isObject(val) &&
445
- (val.toString === objectToString || !isFunction(val.toString)))
446
- ? JSON.stringify(val, replacer, 2)
447
- : String(val);
441
+ return isString(val)
442
+ ? val
443
+ : val == null
444
+ ? ''
445
+ : isArray(val) ||
446
+ (isObject(val) &&
447
+ (val.toString === objectToString || !isFunction(val.toString)))
448
+ ? JSON.stringify(val, replacer, 2)
449
+ : String(val);
448
450
  };
449
451
  const replacer = (_key, val) => {
450
452
  // can't use isRef here since @vue/shared has no deps
@@ -519,6 +521,7 @@ const isReservedProp = /*#__PURE__*/ makeMap(
519
521
  'onVnodeBeforeMount,onVnodeMounted,' +
520
522
  'onVnodeBeforeUpdate,onVnodeUpdated,' +
521
523
  'onVnodeBeforeUnmount,onVnodeUnmounted');
524
+ const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
522
525
  const cacheStringFunction = (fn) => {
523
526
  const cache = Object.create(null);
524
527
  return ((str) => {
@@ -579,4 +582,4 @@ const getGlobalThis = () => {
579
582
  : {}));
580
583
  };
581
584
 
582
- export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, camelize, capitalize, def, escapeHtml, escapeHtmlComment, extend, generateCodeFrame, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isDate, isFunction, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownSvgAttr, isMap, isModelListener, isNoUnitNumericStyleProp, isObject, isOn, isPlainObject, isPromise, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, makeMap, normalizeClass, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };
585
+ export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, camelize, capitalize, def, escapeHtml, escapeHtmlComment, extend, generateCodeFrame, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownSvgAttr, isMap, isModelListener, isNoUnitNumericStyleProp, isObject, isOn, isPlainObject, isPromise, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, 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.2.29",
3
+ "version": "3.2.30",
4
4
  "description": "internal utils shared across @vue packages",
5
5
  "main": "index.js",
6
6
  "module": "dist/shared.esm-bundler.js",