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

types(reactivity): fix corner case on UnwrapRef #614

Merged
merged 1 commit into from
Jan 16, 2020

Conversation

yoyo930021
Copy link
Member

@yoyo930021 yoyo930021 commented Jan 13, 2020

We need special string or number types sometime.
Ex. RelativePath, AbsolutePath

type AbsolutePath = string & { __brand: unknown }
function readFile (path: AbsolutePath) {
  // do some thing
}
function getAbsolutePath (path: string) {
  if (path.startWith('file://')) return path as AbsolutePath
}

I use it for safe use translation keys,
but code is broken when pass UnwrapRef on vetur template interpolation.

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

Successfully merging this pull request may close these issues.

2 participants