@vue/shared 3.4.26 → 3.5.0-alpha.1

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.4.26
2
+ * @vue/shared v3.5.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -85,11 +85,10 @@ const invokeArrayFns = (fns, arg) => {
85
85
  fns[i](arg);
86
86
  }
87
87
  };
88
- const def = (obj, key, value, writable = false) => {
88
+ const def = (obj, key, value) => {
89
89
  Object.defineProperty(obj, key, {
90
90
  configurable: true,
91
91
  enumerable: false,
92
- writable,
93
92
  value
94
93
  });
95
94
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.4.26
2
+ * @vue/shared v3.5.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -85,11 +85,10 @@ const invokeArrayFns = (fns, arg) => {
85
85
  fns[i](arg);
86
86
  }
87
87
  };
88
- const def = (obj, key, value, writable = false) => {
88
+ const def = (obj, key, value) => {
89
89
  Object.defineProperty(obj, key, {
90
90
  configurable: true,
91
91
  enumerable: false,
92
- writable,
93
92
  value
94
93
  });
95
94
  };
package/dist/shared.d.ts CHANGED
@@ -62,7 +62,7 @@ export declare const capitalize: <T extends string>(str: T) => Capitalize<T>;
62
62
  export declare const toHandlerKey: <T extends string>(str: T) => T extends "" ? "" : `on${Capitalize<T>}`;
63
63
  export declare const hasChanged: (value: any, oldValue: any) => boolean;
64
64
  export declare const invokeArrayFns: (fns: Function[], arg?: any) => void;
65
- export declare const def: (obj: object, key: string | symbol, value: any, writable?: boolean) => void;
65
+ export declare const def: (obj: object, key: string | symbol, value: any) => void;
66
66
  /**
67
67
  * "123-foo" will be parsed to 123
68
68
  * This is used for the .number modifier in v-model
@@ -321,4 +321,12 @@ export type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
321
321
  export type Awaited<T> = T extends null | undefined ? T : T extends object & {
322
322
  then(onfulfilled: infer F, ...args: infer _): any;
323
323
  } ? F extends (value: infer V, ...args: infer _) => any ? Awaited<V> : never : T;
324
+ /**
325
+ * Utility for extracting the parameters from a function overload (for typed emits)
326
+ * https://github.com/microsoft/TypeScript/issues/32164#issuecomment-1146737709
327
+ */
328
+ export type OverloadParameters<T extends (...args: any[]) => any> = Parameters<OverloadUnion<T>>;
329
+ type OverloadProps<TOverload> = Pick<TOverload, keyof TOverload>;
330
+ type OverloadUnionRecursive<TOverload, TPartialOverload = unknown> = TOverload extends (...args: infer TArgs) => infer TReturn ? TPartialOverload extends TOverload ? never : OverloadUnionRecursive<TPartialOverload & TOverload, TPartialOverload & ((...args: TArgs) => TReturn) & OverloadProps<TOverload>> | ((...args: TArgs) => TReturn) : never;
331
+ type OverloadUnion<TOverload extends (...args: any[]) => any> = Exclude<OverloadUnionRecursive<(() => never) & TOverload>, TOverload extends () => never ? never : () => never>;
324
332
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.4.26
2
+ * @vue/shared v3.5.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -81,11 +81,10 @@ const invokeArrayFns = (fns, arg) => {
81
81
  fns[i](arg);
82
82
  }
83
83
  };
84
- const def = (obj, key, value, writable = false) => {
84
+ const def = (obj, key, value) => {
85
85
  Object.defineProperty(obj, key, {
86
86
  configurable: true,
87
87
  enumerable: false,
88
- writable,
89
88
  value
90
89
  });
91
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/shared",
3
- "version": "3.4.26",
3
+ "version": "3.5.0-alpha.1",
4
4
  "description": "internal utils shared across @vue packages",
5
5
  "main": "index.js",
6
6
  "module": "dist/shared.esm-bundler.js",