8000 feat(makeDestructurable): support parameters without `as const` (#3971) · vueuse/vueuse@4ea131a · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 4ea131a

Browse files
authored
feat(makeDestructurable): support parameters without as const (#3971)
1 parent 2a77ff3 commit 4ea131a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/shared/makeDestructurable/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const foo = { name: 'foo' }
2020
const bar = 1024
2121

2222
const obj = makeDestructurable(
23-
{ foo, bar } as const,
24-
[foo, bar] as const,
23+
{ foo, bar },
24+
[foo, bar],
2525
)
2626
```
2727

packages/shared/makeDestructurable/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export function makeDestructurable<
22
T extends Record<string, unknown>,
3-
A extends readonly any[],
3+
const A extends readonly any[],
44
>(obj: T, arr: A): T & A {
55
if (typeof Symbol !== 'undefined') {
66
const clone = { ...obj }

0 commit comments

Comments
 (0)
0