@vue/shared 3.2.27 → 3.2.31

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.
@@ -326,8 +326,20 @@ const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,col
326
326
  'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
327
327
  'text,textPath,title,tspan,unknown,use,view';
328
328
  const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';
329
+ /**
330
+ * Compiler only.
331
+ * Do NOT use in runtime code paths unless behind `true` flag.
332
+ */
329
333
  const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);
334
+ /**
335
+ * Compiler only.
336
+ * Do NOT use in runtime code paths unless behind `true` flag.
337
+ */
330
338
  const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
339
+ /**
340
+ * Compiler only.
341
+ * Do NOT use in runtime code paths unless behind `true` flag.
342
+ */
331
343
  const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
332
344
 
333
345
  const escapeRE = /["'&<>]/;
@@ -430,13 +442,15 @@ function looseIndexOf(arr, val) {
430
442
  * @private
431
443
  */
432
444
  const toDisplayString = (val) => {
433
- return val == null
434
- ? ''
435
- : isArray(val) ||
436
- (isObject(val) &&
437
- (val.toString === objectToString || !isFunction(val.toString)))
438
- ? JSON.stringify(val, replacer, 2)
439
- : 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);
440
454
  };
441
455
  const replacer = (_key, val) => {
442
456
  // can't use isRef here since @vue/shared has no deps
@@ -510,6 +524,7 @@ const isReservedProp = /*#__PURE__*/ makeMap(
510
524
  'onVnodeBeforeMount,onVnodeMounted,' +
511
525
  'onVnodeBeforeUpdate,onVnodeUpdated,' +
512
526
  'onVnodeBeforeUnmount,onVnodeUnmounted');
527
+ const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
513
528
  const cacheStringFunction = (fn) => {
514
529
  const cache = Object.create(null);
515
530
  return ((str) => {
@@ -590,6 +605,7 @@ exports.includeBooleanAttr = includeBooleanAttr;
590
605
  exports.invokeArrayFns = invokeArrayFns;
591
606
  exports.isArray = isArray;
592
607
  exports.isBooleanAttr = isBooleanAttr;
608
+ exports.isBuiltInDirective = isBuiltInDirective;
593
609
  exports.isDate = isDate;
594
610
  exports.isFunction = isFunction;
595
611
  exports.isGloballyWhitelisted = isGloballyWhitelisted;
@@ -326,8 +326,20 @@ const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,col
326
326
  'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
327
327
  'text,textPath,title,tspan,unknown,use,view';
328
328
  const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';
329
+ /**
330
+ * Compiler only.
331
+ * Do NOT use in runtime code paths unless behind `false` flag.
332
+ */
329
333
  const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);
334
+ /**
335
+ * Compiler only.
336
+ * Do NOT use in runtime code paths unless behind `false` flag.
337
+ */
330
338
  const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
339
+ /**
340
+ * Compiler only.
341
+ * Do NOT use in runtime code paths unless behind `false` flag.
342
+ */
331
343
  const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
332
344
 
333
345
  const escapeRE = /["'&<>]/;
@@ -430,13 +442,15 @@ function looseIndexOf(arr, val) {
430
442
  * @private
431
443
  */
432
444
  const toDisplayString = (val) => {
433
- return val == null
434
- ? ''
435
- : isArray(val) ||
436
- (isObject(val) &&
437
- (val.toString === objectToString || !isFunction(val.toString)))
438
- ? JSON.stringify(val, replacer, 2)
439
- : 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);
440
454
  };
441
455
  const replacer = (_key, val) => {
442
456
  // can't use isRef here since @vue/shared has no deps
@@ -509,6 +523,7 @@ const isReservedProp = /*#__PURE__*/ makeMap(
509
523
  'onVnodeBeforeMount,onVnodeMounted,' +
510
524
  'onVnodeBeforeUpdate,onVnodeUpdated,' +
511
525
  'onVnodeBeforeUnmount,onVnodeUnmounted');
526
+ const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
512
527
  const cacheStringFunction = (fn) => {
513
528
  const cache = Object.create(null);
514
529
  return ((str) => {
@@ -589,6 +604,7 @@ exports.includeBooleanAttr = includeBooleanAttr;
589
604
  exports.invokeArrayFns = invokeArrayFns;
590
605
  exports.isArray = isArray;
591
606
  exports.isBooleanAttr = isBooleanAttr;
607
+ exports.isBuiltInDirective = isBuiltInDirective;
592
608
  exports.isDate = isDate;
593
609
  exports.isFunction = isFunction;
594
610
  exports.isGloballyWhitelisted = isGloballyWhitelisted;
package/dist/shared.d.ts CHANGED
@@ -57,12 +57,18 @@ 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;
63
65
 
64
66
  export declare const isGloballyWhitelisted: (key: string) => boolean;
65
67
 
68
+ /**
69
+ * Compiler only.
70
+ * Do NOT use in runtime code paths unless behind `__DEV__` flag.
71
+ */
66
72
  export declare const isHTMLTag: (key: string) => boolean;
67
73
 
68
74
  export declare const isIntegerKey: (key: unknown) => boolean;
@@ -107,10 +113,18 @@ export declare function isSSRSafeAttrName(name: string): boolean;
107
113
 
108
114
  export declare const isString: (val: unknown) => val is string;
109
115
 
116
+ /**
117
+ * Compiler only.
118
+ * Do NOT use in runtime code paths unless behind `__DEV__` flag.
119
+ */
110
120
  export declare const isSVGTag: (key: string) => boolean;
111
121
 
112
122
  export declare const isSymbol: (val: unknown) => val is symbol;
113
123
 
124
+ /**
125
+ * Compiler only.
126
+ * Do NOT use in runtime code paths unless behind `__DEV__` flag.
127
+ */
114
128
  export declare const isVoidTag: (key: string) => boolean;
115
129
 
116
130
  export declare function looseEqual(a: any, b: any): boolean;
@@ -322,8 +322,20 @@ const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,col
322
322
  'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
323
323
  'text,textPath,title,tspan,unknown,use,view';
324
324
  const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';
325
+ /**
326
+ * Compiler only.
327
+ * Do NOT use in runtime code paths unless behind `(process.env.NODE_ENV !== 'production')` flag.
328
+ */
325
329
  const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);
330
+ /**
331
+ * Compiler only.
332
+ * Do NOT use in runtime code paths unless behind `(process.env.NODE_ENV !== 'production')` flag.
333
+ */
326
334
  const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
335
+ /**
336
+ * Compiler only.
337
+ * Do NOT use in runtime code paths unless behind `(process.env.NODE_ENV !== 'production')` flag.
338
+ */
327
339
  const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
328
340
 
329
341
  const escapeRE = /["'&<>]/;
@@ -426,13 +438,15 @@ function looseIndexOf(arr, val) {
426
438
  * @private
427
439
  */
428
440
  const toDisplayString = (val) => {
429
- return val == null
430
- ? ''
431
- : isArray(val) ||
432
- (isObject(val) &&
433
- (val.toString === objectToString || !isFunction(val.toString)))
434
- ? JSON.stringify(val, replacer, 2)
435
- : 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);
436
450
  };
437
451
  const replacer = (_key, val) => {
438
452
  // can't use isRef here since @vue/shared has no deps
@@ -507,6 +521,7 @@ const isReservedProp = /*#__PURE__*/ makeMap(
507
521
  'onVnodeBeforeMount,onVnodeMounted,' +
508
522
  'onVnodeBeforeUpdate,onVnodeUpdated,' +
509
523
  'onVnodeBeforeUnmount,onVnodeUnmounted');
524
+ const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
510
525
  const cacheStringFunction = (fn) => {
511
526
  const cache = Object.create(null);
512
527
  return ((str) => {
@@ -567,4 +582,4 @@ const getGlobalThis = () => {
567
582
  : {}));
568
583
  };
569
584
 
570
- 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.27",
3
+ "version": "3.2.31",
4
4
  "description": "internal utils shared across @vue packages",
5
5
  "main": "index.js",
6
6
  "module": "dist/shared.esm-bundler.js",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "git+https://github.com/vuejs/vue-next.git",
20
+ "url": "git+https://github.com/vuejs/core.git",
21
21
  "directory": "packages/shared"
22
22
  },
23
23
  "keywords": [
@@ -26,7 +26,7 @@
26
26
  "author": "Evan You",
27
27
  "license": "MIT",
28
28
  "bugs": {
29
- "url": "https://github.com/vuejs/vue-next/issues"
29
+ "url": "https://github.com/vuejs/core/issues"
30
30
  },
31
- "homepage": "https://github.com/vuejs/vue-next/tree/master/packages/shared#readme"
31
+ "homepage": "https://github.com/vuejs/core/tree/main/packages/shared#readme"
32
32
  }