-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
If input is not valid MARC serialization, the result of parsing is not well-defined. I guess from certain point of view this is not a bug but a feature, but I wish to get at least a warning on broken input.
Some examples:
console.log(Marc.parse("abc", "iso2709"))Record { leader: 'abc', fields: [] }
console.log(Marc.parse("123", "iso2709"))Record {
leader: '123',
fields: [
[ '123', '12' ],
[ '123', '12' ],
[ '123', '12' ],
[ '123', '12' ],
[ '123', '12' ],
[ '123', '12' ],
[ '123', '12' ],
[ '123', '12' ],
[ '123', '12' ]
]
}
// broken XML, malformed leader and tag
const marcxml = `<record
<leader>X</leader>
<controlfield tag="1234">YYY</controlfield>
</record>`;
console.log(Marc.parse(marcxml, 'marcxml'))Record { leader: 'X', fields: [ [ '123', '>YYY' ] ] }
Metadata
Metadata
Assignees
Labels
No labels