Citation.js converts formats like BibTeX, Wikidata JSON and ContentMine JSON to CSL-JSON to convert to other formats like APA, Vancouver and back to BibTeX.
When infoPart.type is a string it shouldn't be tested with .includes(). Subtle, because there's a String.prototype.includes as well as the array version, so it doesn't throw an error. This usually doesn't matter, but it could when, for example, infoPart.type = 'article-journal' and entry.type = 'article'.
Expected behaviour: true when infoPart.type is a string is the same as entry.type or when infoPart.type is an array, one of the elements being the same as entry.type; false otherwise.
https://github.com/larsgw/citation.js/blob/61d0bd3bf81af7e97c18c8128101815b068104c1/src/get/modules/ris/index.js#L174
When
infoPart.type
is a string it shouldn't be tested with.includes()
. Subtle, because there's aString.prototype.includes
as well as the array version, so it doesn't throw an error. This usually doesn't matter, but it could when, for example,infoPart.type = 'article-journal'
andentry.type = 'article'
.Expected behaviour: true when
infoPart.type
is a string is the same asentry.type
or wheninfoPart.type
is an array, one of the elements being the same asentry.type
; false otherwise.