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 #261

Merged
merged 1 commit into from
Mar 12, 2020

Conversation

yoyo930021
Copy link
Member

Same as vuejs/core#614

We need special string or number types sometimes.
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 passing UnwrapRef on vetur template interpolation.

@LinusBorg LinusBorg requested a review from ktsn March 11, 2020 14:30
@LinusBorg
Copy link
Member

@ktsn What do you think about this PR?

Copy link
Member

@ktsn ktsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@sodatea sodatea merged commit 817d4d1 into vuejs:master Mar 12, 2020
pikax pushed a commit to pikax/vue-function-api that referenced this pull request Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants