Skip to content

types(reactive): remove unnecessary type assertion #6143

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

Closed
wants to merge 2 commits into from

Conversation

zqran
Copy link
Contributor

@zqran zqran commented Jun 20, 2022

Remove unnecessary types in toReadonly function to be consistent with toReactive function.

Details:

export const toReadonly = <T extends unknown>(value: T): T =>
  isObject(value) ? readonly(value as Record<any, any>) : value

when isObject(value) is true, the type of value is Record<any, any>, so no longer need as Record<any, any>

@netlify
Copy link

netlify bot commented Jun 20, 2022

Deploy Preview for vuejs-coverage failed.

Name Link
🔨 Latest commit 188254d
🔍 Latest deploy log https://app.netlify.com/sites/vuejs-coverage/deploys/62b028c90d623b0008890334

@zqran zqran changed the title refactor(reactive): remove unnecessary type assertion types(reactive): remove unnecessary type assertion Jun 23, 2022
@haoqunjiang haoqunjiang added the 🧹 p1-chore Priority 1: this doesn't change code behavior. label Apr 1, 2024
@haoqunjiang
Copy link
Member

Closing as it's been refactored in #8046
Somehow GitHub failed to update the diff in time.

@haoqunjiang haoqunjiang closed this Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 p1-chore Priority 1: this doesn't change code behavior.
Projects
Status: Rejected
Development

Successfully merging this pull request may close these issues.

2 participants