Skip to content
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

Consider deprecating toRawType(value) #184

Open
Raruto opened this issue Sep 14, 2022 · 2 comments
Open

Consider deprecating toRawType(value) #184

Raruto opened this issue Sep 14, 2022 · 2 comments

Comments

@Raruto
Copy link
Collaborator

Raruto commented Sep 14, 2022

Probably a legacy of the past, anyway, I can't find any real use for it (other than making the code more difficult to read), for most situations typeof or instanceof should suffice..

toRawType(value) {
const _toString = Object.prototype.toString;
return _toString.call(value).slice(8, -1)
},

More info

@Raruto
Copy link
Collaborator Author

Raruto commented Jan 31, 2023

This function seems to have been copied from vuejs 2 shared utilities:

vuejs/vue/src/shared/util.ts

export function toRawType(value: any): string {
  return _toString.call(value).slice(8, -1)
}

TODO find out it is somehow feasible to outsource this utility when will switch to vue v3 (or even now, when we will use npm packages, including it directly from the vue v2 node_modules folder, ref: #290)

@volterra79
Copy link
Member

@Raruto it copied from vue2 as you reported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants