Skip to content

Commit

Permalink
Trata extensões com apenas um campo no DwC
Browse files Browse the repository at this point in the history
  • Loading branch information
Phenome committed Jan 24, 2024
1 parent 7f8f0ac commit 859ccfe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/dwca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ type DwcJson = Record<
const _parseJsonEntry = (entry: CoreSpec | ExtensionSpec) => {
const fields = []
fields[(entry.id ?? entry.coreid)['@index']] = 'INDEX'
if (!Array.isArray(entry.field)) {
entry.field = [entry.field]
}
entry.field.forEach((field) => {
fields[field['@index']] = field['@term'].split('/').pop()
})
Expand Down

0 comments on commit 859ccfe

Please sign in to comment.