Skip to content

Isbn issn

Minttu Hurme edited this page Jan 28, 2021 · 10 revisions

Description

Handles ISBN and ISSN values. As default whole record is marked as failed.

Notes:

  • Non-hyphenated ISBNs are considered invalid in validate if hyphenateISBN is true.
  • Hyphenation and moving invalid values result in duplicate fields, if similar fields exist in record already

Configuration

  • hyphenateISBN: Add hyphens to ISBN. Defaults to false.
  • handleInvalid: Invalid values are fixed by moving them to z- and y-subfields (ISBN and ISSN respectively). Defaults to false.

Examples

Valid record

{
  leader: 'foo',
  fields: [
    {
      tag: '020',
      ind1: ' ',
      ind2: ' ',
      subfields: [{code: 'a', value: '978-951-9155-47-0'}]
    },
    {
      tag: '022',
      ind1: ' ',
      ind2: ' ',
      subfields: [{code: 'a', value: '0355-0893'}]
    }
  ]
}

Invalid record

{
  leader: 'foo',
  fields: [
    {
      tag: '020',
      ind1: ' ',
      ind2: ' ',
      subfields: [{code: 'a', value: 'foo'}]
    },
    {
      tag: '022',
      ind1: ' ',
      ind2: ' ',
      subfields: [{code: 'a', value: 'bar'}]
    }
  ]
}

Fixed record

{
  leader: 'foo',
  fields: [
    {
      tag: '020',
      ind1: ' ',
      ind2: ' ',
      subfields: [{code: 'z', value: '000-000-0000-00-0'}]
    },
    {
      tag: '022',
      ind1: ' ',
      ind2: ' ',
      subfields: [{code: 'y', value: '0000-0000'}]
    }
  ]
}