customcommander / customcommander/ris

Verbose mode

Open
#59 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Gherkin
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

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

## Examples

### Invalid RIS content

```none
TY - MUSIC
TI - Wonderwall
```

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

### Writing RIS

```javascript
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

```none
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.

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

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.