@vue/shared 3.5.0-alpha.5 → 3.5.0-beta.2

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.5.0-alpha.5
2
+ * @vue/shared v3.5.0-beta.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -65,9 +65,11 @@ const cacheStringFunction = (fn) => {
65
65
  };
66
66
  };
67
67
  const camelizeRE = /-(\w)/g;
68
- const camelize = cacheStringFunction((str) => {
69
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
70
- });
68
+ const camelize = cacheStringFunction(
69
+ (str) => {
70
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
71
+ }
72
+ );
71
73
  const hyphenateRE = /\B([A-Z])/g;
72
74
  const hyphenate = cacheStringFunction(
73
75
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
@@ -75,10 +77,12 @@ const hyphenate = cacheStringFunction(
75
77
  const capitalize = cacheStringFunction((str) => {
76
78
  return str.charAt(0).toUpperCase() + str.slice(1);
77
79
  });
78
- const toHandlerKey = cacheStringFunction((str) => {
79
- const s = str ? `on${capitalize(str)}` : ``;
80
- return s;
81
- });
80
+ const toHandlerKey = cacheStringFunction(
81
+ (str) => {
82
+ const s = str ? `on${capitalize(str)}` : ``;
83
+ return s;
84
+ }
85
+ );
82
86
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
83
87
  const invokeArrayFns = (fns, ...arg) => {
84
88
  for (let i = 0; i < fns.length; i++) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.5.0-alpha.5
2
+ * @vue/shared v3.5.0-beta.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -65,9 +65,11 @@ const cacheStringFunction = (fn) => {
65
65
  };
66
66
  };
67
67
  const camelizeRE = /-(\w)/g;
68
- const camelize = cacheStringFunction((str) => {
69
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
70
- });
68
+ const camelize = cacheStringFunction(
69
+ (str) => {
70
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
71
+ }
72
+ );
71
73
  const hyphenateRE = /\B([A-Z])/g;
72
74
  const hyphenate = cacheStringFunction(
73
75
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
@@ -75,10 +77,12 @@ const hyphenate = cacheStringFunction(
75
77
  const capitalize = cacheStringFunction((str) => {
76
78
  return str.charAt(0).toUpperCase() + str.slice(1);
77
79
  });
78
- const toHandlerKey = cacheStringFunction((str) => {
79
- const s = str ? `on${capitalize(str)}` : ``;
80
- return s;
81
- });
80
+ const toHandlerKey = cacheStringFunction(
81
+ (str) => {
82
+ const s = str ? `on${capitalize(str)}` : ``;
83
+ return s;
84
+ }
85
+ );
82
86
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
83
87
  const invokeArrayFns = (fns, ...arg) => {
84
88
  for (let i = 0; i < fns.length; i++) {
package/dist/shared.d.ts CHANGED
@@ -18,16 +18,11 @@ export declare const NOOP: () => void;
18
18
  */
19
19
  export declare const NO: () => boolean;
20
20
  export declare const isOn: (key: string) => boolean;
21
- export declare const isModelListener: (key: string) => boolean;
22
- export declare const extend: {
23
- <T extends {}, U>(target: T, source: U): T & U;
24
- <T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
25
- <T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
26
- (target: object, ...sources: any[]): any;
27
- };
21
+ export declare const isModelListener: (key: string) => key is `onUpdate:${string}`;
22
+ export declare const extend: typeof Object.assign;
28
23
  export declare const remove: <T>(arr: T[], el: T) => void;
29
- export declare const hasOwn: (val: object, key: string | symbol) => key is never;
30
- export declare const isArray: (arg: any) => arg is any[];
24
+ export declare const hasOwn: (val: object, key: string | symbol) => key is keyof typeof val;
25
+ export declare const isArray: typeof Array.isArray;
31
26
  export declare const isMap: (val: unknown) => val is Map<any, any>;
32
27
  export declare const isSet: (val: unknown) => val is Set<any>;
33
28
  export declare const isDate: (val: unknown) => val is Date;
@@ -37,7 +32,7 @@ export declare const isString: (val: unknown) => val is string;
37
32
  export declare const isSymbol: (val: unknown) => val is symbol;
38
33
  export declare const isObject: (val: unknown) => val is Record<any, any>;
39
34
  export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
40
- export declare const objectToString: () => string;
35
+ export declare const objectToString: typeof Object.prototype.toString;
41
36
  export declare const toTypeString: (value: unknown) => string;
42
37
  export declare const toRawType: (value: unknown) => string;
43
38
  export declare const isPlainObject: (val: unknown) => val is object;
@@ -59,7 +54,7 @@ export declare const capitalize: <T extends string>(str: T) => Capitalize<T>;
59
54
  /**
60
55
  * @private
61
56
  */
62
- export declare const toHandlerKey: <T extends string>(str: T) => T extends "" ? "" : `on${Capitalize<T>}`;
57
+ export declare const toHandlerKey: <T extends string>(str: T) => T extends '' ? '' : `on${Capitalize<T>}`;
63
58
  export declare const hasChanged: (value: any, oldValue: any) => boolean;
64
59
  export declare const invokeArrayFns: (fns: Function[], ...arg: any[]) => void;
65
60
  export declare const def: (obj: object, key: string | symbol, value: any, writable?: boolean) => void;
@@ -230,11 +225,7 @@ export declare enum SlotFlags {
230
225
  /**
231
226
  * Dev only
232
227
  */
233
- export declare const slotFlagsText: {
234
- 1: string;
235
- 2: string;
236
- 3: string;
237
- };
228
+ export declare const slotFlagsText: Record<SlotFlags, string>;
238
229
 
239
230
  export declare const isGloballyAllowed: (key: string) => boolean;
240
231
  /** @deprecated use `isGloballyAllowed` instead */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.5.0-alpha.5
2
+ * @vue/shared v3.5.0-beta.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -61,9 +61,11 @@ const cacheStringFunction = (fn) => {
61
61
  };
62
62
  };
63
63
  const camelizeRE = /-(\w)/g;
64
- const camelize = cacheStringFunction((str) => {
65
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
66
- });
64
+ const camelize = cacheStringFunction(
65
+ (str) => {
66
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
67
+ }
68
+ );
67
69
  const hyphenateRE = /\B([A-Z])/g;
68
70
  const hyphenate = cacheStringFunction(
69
71
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
@@ -71,10 +73,12 @@ const hyphenate = cacheStringFunction(
71
73
  const capitalize = cacheStringFunction((str) => {
72
74
  return str.charAt(0).toUpperCase() + str.slice(1);
73
75
  });
74
- const toHandlerKey = cacheStringFunction((str) => {
75
- const s = str ? `on${capitalize(str)}` : ``;
76
- return s;
77
- });
76
+ const toHandlerKey = cacheStringFunction(
77
+ (str) => {
78
+ const s = str ? `on${capitalize(str)}` : ``;
79
+ return s;
80
+ }
81
+ );
78
82
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
79
83
  const invokeArrayFns = (fns, ...arg) => {
80
84
  for (let i = 0; i < fns.length; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/shared",
3
- "version": "3.5.0-alpha.5",
3
+ "version": "3.5.0-beta.2",
4
4
  "description": "internal utils shared across @vue packages",
5
5
  "main": "index.js",
6
6
  "module": "dist/shared.esm-bundler.js",