-
Notifications
You must be signed in to change notification settings - Fork 18
feat(core): dereference elements with valueOf #561
Conversation
94a81b6
to
63c5a14
Compare
63c5a14
to
7764adf
Compare
packages/api-elements/lib/utils.js
Outdated
* Get element attribute | ||
* @param {element} e - element - element | ||
* @param {string} attribute | ||
* @return {boolean} |
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.
I think this isn't true, getAttribute
would return Element
(member value) or undefined.
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.
Addressed on cdeebcf
packages/api-elements/lib/utils.js
Outdated
*/ | ||
const isOptional = e => hasTypeAttribute(e, 'optional'); | ||
|
||
const baseTypes = new Set(['boolean', 'string', 'number', 'array', 'object', 'enum']); |
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.
Should this include null
?
There's also other refract base types:member
, select
, option
, extend
, ref
and link
(https://apielements.org/en/latest/element-definitions.html#data-structure-element-types) elements. Although perhaps for purposes of check you don't want those.
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 makes sense to add them all to the list.
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.
Addressed on add7f25
ea823ff
to
60121f0
Compare
No description provided.