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
feat: support boolean attributes #652
base: master
Are you sure you want to change the base?
Conversation
@@ -299,6 +300,7 @@ exports.lib = {}; | |||
exports.lib.mdurl = require('mdurl'); | |||
exports.lib.ucmicro = require('uc.micro'); | |||
|
|||
exports.isNil = isNil; |
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.
It's not good idea to spread micro helpers as lib feature, when used in only one place. Such things clutter api significantly in long term.
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.
Was trying to follow the existing organization.
Where do you want it?
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.
Until "helper" is not used wide, it should be in the same file where it's needed. Preferably - inlined, without separate fn at all.
We need do discuss final data format in original issue. I don't like duality (null & undefined) for single case, especially when it's hidden behind api call. |
I'm okay with just checking against Let me know what you decide and I'll update. |
I understand. I left issue open to discuss signature proposals from other users. Did not thinked about it myself, because issue is not too hot and can be hacked at user side (without dependency on my personal opinion). |
I have no strong preference but would like to add that boolean attributes can also be set to their own name to signify a true value (e.g. |
#598
Supports:
.attrSet('download')
on Token.attrs.push(['download'])
on Token.attrs.push(['download', null])
on Token.attrs.push(['download', undefined])
on Token