-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(plugin:export): it should have default value 'true' through doc #4111
fix(plugin:export): it should have default value 'true' through doc #4111
Conversation
// without instance.hasOwnProperty method cause by ts rule. | ||
// the condition will be false if these properties have been set undefined in the target, | ||
// but will be true if these properties are not in the target, cause the doc. | ||
!Object.prototype.hasOwnProperty.call(options, 'copyStyle') && |
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.
Because the following judgment is options.copyStyles !== false
, so if it is not passed, it is also executed in accordance with true.
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.
In fact, we just have a difference about what is the true . It will execute correctly under the strict-Boolean-type. The options.copyStyles !== false
is a strict un-equality which likes ===.But, the serializeImages condition in line 209 is not strict which likes ==.So, In my option, we should keep the same style about the serializeImages and copyStyle condition what are both the Boolean value through the docs on the one hand, on the other hand, It should excute false statement when the value is either ''
, or ``
, or null
,or undefined
,or NAN
. All above these just beacuse JS is a fuck weak type language😓.
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.
👍
// without instance.hasOwnProperty method cause by ts rule. | ||
// the condition will be false if these properties have been set undefined in the target, | ||
// but will be true if these properties are not in the target, cause the doc. | ||
!Object.prototype.hasOwnProperty.call(options, 'copyStyle') && |
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.
👍
👋 @Sorryhx Congrats on merging your first pull request! 🎉🎉🎉 |
Description
@antv/x6-plugin-export's options table show that the default-value of serializeImages and copyStyles is the true.However, the option argument has been set {} which will cause serializeImages or copyStyles is undefined in runtime. the logical truth code won't be executed.
Motivation and Context
Types of changes
Self Check before Merge