Skip to content

Verbose mode #59

@customcommander

Description

@customcommander

By default the library is quite terse with regards to errors in general and validation errors specifically.

Examples

Invalid RIS content

TY  - MUSIC
TI  - Wonderwall

The parser will fail because there is no ER entry to signal the end of the record.

Writing RIS

write([{TY: ['MUSIC'], TI: 'Wonderwall'}])

This library has defined RIS record as plain JavaScript objects which keys follow the notation for tags and values are always arrays of strings. This object isn't valid and the library will ignore it and return an empty RIS file.

Errors when moving across domain

TY  - JOUR
ER  - 

This is a valid RIS file but when converted into a list of Mendeley references the library will return an empty list. Why? In Mendeley all references MUST have a type and a title which this RIS record does not. The library did convert the RIS record into a Mendeley reference but eventually discarded it because it was invalid.

Proposal

The library should still be non-verbose by default but expose a communication channel for errors e.g.

const {onError} = require('@customcommander/ris');

onError((err) => {
  // …
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions