I notice that the term is actually relying on how it handles null values and undefined as return value. Thus, I'd propose a change as follows so that empty string or zeros are not ignored.
- if (!value) {
+ if (value === null || typeof value === 'undefined') {
When passing empty string to create a node with clownface,
undefined
is returned which causes hard to detect errors down the line.The problem lies on this line: https://github.com/rdf-ext/clownface/blob/master/lib/term.js#L53-L55
I notice that the
term
is actually relying on how it handlesnull
values andundefined
as return value. Thus, I'd propose a change as follows so that empty string or zeros are not ignored.