@vue/shared 3.2.26 → 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.
- package/dist/shared.cjs.js +23 -7
- package/dist/shared.cjs.prod.js +23 -7
- package/dist/shared.d.ts +22 -0
- package/dist/shared.esm-bundler.js +23 -8
- package/package.json +4 -4
package/dist/shared.cjs.js
CHANGED
|
@@ -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
|
|
434
|
-
?
|
|
435
|
-
:
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
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;
|
package/dist/shared.cjs.prod.js
CHANGED
|
@@ -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
|
|
434
|
-
?
|
|
435
|
-
:
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
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
|
@@ -40,6 +40,8 @@ export declare const hasOwn: (val: object, key: string | symbol) => key is never
|
|
|
40
40
|
*/
|
|
41
41
|
export declare const hyphenate: (str: string) => string;
|
|
42
42
|
|
|
43
|
+
export declare type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N;
|
|
44
|
+
|
|
43
45
|
/**
|
|
44
46
|
* Boolean attributes should be included if the value is truthy or ''.
|
|
45
47
|
* e.g. `<select multiple>` compiles to `{ multiple: '' }`
|
|
@@ -55,12 +57,18 @@ export declare const isArray: (arg: any) => arg is any[];
|
|
|
55
57
|
*/
|
|
56
58
|
export declare const isBooleanAttr: (key: string) => boolean;
|
|
57
59
|
|
|
60
|
+
export declare const isBuiltInDirective: (key: string) => boolean;
|
|
61
|
+
|
|
58
62
|
export declare const isDate: (val: unknown) => val is Date;
|
|
59
63
|
|
|
60
64
|
export declare const isFunction: (val: unknown) => val is Function;
|
|
61
65
|
|
|
62
66
|
export declare const isGloballyWhitelisted: (key: string) => boolean;
|
|
63
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Compiler only.
|
|
70
|
+
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
71
|
+
*/
|
|
64
72
|
export declare const isHTMLTag: (key: string) => boolean;
|
|
65
73
|
|
|
66
74
|
export declare const isIntegerKey: (key: unknown) => boolean;
|
|
@@ -105,16 +113,28 @@ export declare function isSSRSafeAttrName(name: string): boolean;
|
|
|
105
113
|
|
|
106
114
|
export declare const isString: (val: unknown) => val is string;
|
|
107
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Compiler only.
|
|
118
|
+
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
119
|
+
*/
|
|
108
120
|
export declare const isSVGTag: (key: string) => boolean;
|
|
109
121
|
|
|
110
122
|
export declare const isSymbol: (val: unknown) => val is symbol;
|
|
111
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Compiler only.
|
|
126
|
+
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
127
|
+
*/
|
|
112
128
|
export declare const isVoidTag: (key: string) => boolean;
|
|
113
129
|
|
|
114
130
|
export declare function looseEqual(a: any, b: any): boolean;
|
|
115
131
|
|
|
116
132
|
export declare function looseIndexOf(arr: any[], val: any): number;
|
|
117
133
|
|
|
134
|
+
export declare type LooseRequired<T> = {
|
|
135
|
+
[P in string & keyof T]: T[P];
|
|
136
|
+
};
|
|
137
|
+
|
|
118
138
|
/**
|
|
119
139
|
* Make a map and return a function for checking if a key
|
|
120
140
|
* is in that map.
|
|
@@ -329,4 +349,6 @@ export declare const toRawType: (value: unknown) => string;
|
|
|
329
349
|
|
|
330
350
|
export declare const toTypeString: (value: unknown) => string;
|
|
331
351
|
|
|
352
|
+
export declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
353
|
+
|
|
332
354
|
export { }
|
|
@@ -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
|
|
430
|
-
?
|
|
431
|
-
:
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
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.
|
|
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",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/vuejs/
|
|
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/
|
|
29
|
+
"url": "https://github.com/vuejs/core/issues"
|
|
30
30
|
},
|
|
31
|
-
"homepage": "https://github.com/vuejs/
|
|
31
|
+
"homepage": "https://github.com/vuejs/core/tree/main/packages/shared#readme"
|
|
32
32
|
}
|