loaders ยป string
string() โ string
stringItems() โ array
stringList() โ array
Technically not a loader, but an alias for the standard accessors (which always
return strings), you can use it if you prefer a 100% type-oriented value access
terminology in your code. Note that this is not even a noop function, but really
just a direct alias, so using it instead of e.g. field
does not incur any
performance drawback.
enoname: Alice
number: 13
javascriptconst document = eno.parse(input);
document.string('name'); // returns 'Alice'
document.string('number'); // returns '13'
// .... these are completely identical to ...
document.field('name'); // returns 'Alice'
document.field('number'); // returns '13'