-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
refactor: Add isString #8038
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
base: dev
Are you sure you want to change the base?
refactor: Add isString #8038
Conversation
src/compiler/codegen/index.js
Outdated
@@ -499,7 +499,7 @@ function genProps (props: Array<{ name: string, value: any }>): string { | |||
|
|||
/* istanbul ignore next */ | |||
function generateValue (value) { | |||
if (typeof value === 'string') { | |||
if (isString(value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about return isString(value) ? transformSpecialNewlines(value) : JSON.stringify(value)
notation ?
Is this really needed or something just more like over-engineering? |
For me it's good approach to create There are methods like Please also take a look here: |
As said lusarz, there is methods like isTrue|isFalse|isObject|isPrimitive, so i dont see over-engineering here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to resolve merge conflicts.
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
dev
branch for v2.x (or to a previous version branch), not themaster
branchfix #xxx[,#xxx]
, where "xxx" is the issue number)