Skip to content

Commit

Permalink
Disallow f264 duplication: only first entry of dc.title.alternative g…
Browse files Browse the repository at this point in the history
…enerates the field
  • Loading branch information
aatuny committed Nov 4, 2024
1 parent 746584f commit 146089f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
10 changes: 6 additions & 4 deletions src/transform/convert/common/generate2xx.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ export function generate245({getFields, getFieldValues}) {
*/
export function generate246({getFieldValues}) {
const values = getFieldValues('dc.title.alternative');
return values.map(value => ({
tag: '246', ind1: '1', ind2: '3',
subfields: [{code: 'a', value}]
}));
return values.length > 0 ? [
{
tag: '246', ind1: '1', ind2: '3',
subfields: [{code: 'a', value: values[0]}]
}
] : [];
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"description": "Generates a f246 from each dc.title.alternative information.",
"description": "Generates a f246 from first dc.title.alternative information.",
"only": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,5 @@
"subfields": [
{"code": "a", "value": "Dublin Core - MARC21 -conversion"}
]
},
{
"tag": "246", "ind1": "1", "ind2": "3",
"subfields": [
{"code": "a", "value": "Och samma på svenska"}
]
}
]

0 comments on commit 146089f

Please sign in to comment.