Next Perpendicular Moonlanding

    @natlibfi/marc-record-validate

    6.0.1 • Public • Published

    Validate and fix MARC records NPM Version Build Status Test Coverage

    Javascript module to validate and fix MARC records.

    Usage

    import {DoubleCommas} from '@natlibfi/marc-record-validators-melinda';
    import validateFactory from '@natlibfi/marc-record-validate';
     
    async function run() {
      const validate = validateFactory([await DoubleCommas()]);
      const result = await validate(marcRecord);
    }

    Configuration

    The module returns a factory function that takes an array of validators as an argument. The factory creates a validate function that takes a MARC record instance and optional options as an object:

    • fix: Whether to run fix-method of the validator or not. Defaults to false
    • failOnError: Do not running remaining validators if the record does not validate (And cannot be fixed if fix is set to true). Defaults to false
    • validateFixes: Re-run validators after all validators have been processed. Only the validate-method will be called so that fixes are not applied twice. Defaults to false

    Validators

    See marc-record-validators-melinda for reference on how to write validators.

    License and copyright

    Copyright (c) 2014-2019 University Of Helsinki (The National Library Of Finland)

    This project's source code is licensed under the terms of GNU Lesser General Public License Version 3 or any later version.

    Keywords

    none

    Install

    npm i @natlibfi/marc-record-validate

    DownloadsWeekly Downloads

    68

    Version

    6.0.1

    License

    LGPL-3.0+

    Unpacked Size

    57.5 kB

    Total Files

    11

    Last publish

    Collaborators

    • avatar