8000 refactor(makeDestructurable): use const type parameters by enpitsuLin · Pull Request #3971 · vueuse/vueuse · GitHub
[go: up one dir, main page]

Skip to content

refactor(makeDestructurable): use const type parameters #3971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: use const type parameters
  • Loading branch information
enpitsuLin committed May 15, 2024
commit 95419b3ee59ab180e2e7de4fc56e17358b5d523f
4 changes: 2 additions & 2 deletions packages/shared/makeDestructurable/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const foo = { name: 'foo' }
const bar = 1024

const obj = makeDestructurable(
{ foo, bar } as const,
[foo, bar] as const,
{ foo, bar },
[foo, bar],
)
```

Expand Down
2 changes: 1 addition & 1 deletion packages/shared/makeDestructurable/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function makeDestructurable<
T extends Record<string, unknown>,
A extends readonly any[],
const A extends readonly any[],
>(obj: T, arr: A): T & A {
if (typeof Symbol !== 'undefined') {
const clone = { ...obj }
Expand Down
0