@natlibfi/marc-record-merge 5.0.0 → 6.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.drone.yml +92 -0
- package/.github/CODEOWNERS +9 -0
- package/.github/dependabot.yml +41 -0
- package/.github/workflows/melinda-node-tests.yml +60 -0
- package/LICENSE +21 -0
- package/README.md +64 -246
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/reducers/copy.js +297 -0
- package/dist/reducers/copy.js.map +1 -0
- package/dist/reducers/copy.spec.js +68 -0
- package/dist/reducers/copy.spec.js.map +1 -0
- package/dist/reducers/index.js +25 -0
- package/dist/reducers/index.js.map +1 -0
- package/dist/reducers/select.js +130 -0
- package/dist/reducers/select.js.map +1 -0
- package/dist/reducers/select.spec.js +68 -0
- package/dist/reducers/select.spec.js.map +1 -0
- package/package.json +103 -57
- package/src/index.js +4 -0
- package/src/reducers/copy.js +274 -0
- package/src/reducers/copy.spec.js +48 -0
- package/src/reducers/index.js +4 -0
- package/src/reducers/select.js +107 -0
- package/src/reducers/select.spec.js +45 -0
- package/test-fixtures/reducers/copy/basic copy/01/base.json +9 -0
- package/test-fixtures/reducers/copy/basic copy/01/merged.json +20 -0
- package/test-fixtures/reducers/copy/basic copy/01/metadata.json +5 -0
- package/test-fixtures/reducers/copy/basic copy/01/source.json +20 -0
- package/test-fixtures/reducers/copy/basic copy/02/base.json +20 -0
- package/test-fixtures/reducers/copy/basic copy/02/merged.json +20 -0
- package/test-fixtures/reducers/copy/basic copy/02/metadata.json +5 -0
- package/test-fixtures/reducers/copy/basic copy/02/source.json +20 -0
- package/test-fixtures/reducers/copy/basic copy/03/base.json +20 -0
- package/test-fixtures/reducers/copy/basic copy/03/merged.json +28 -0
- package/test-fixtures/reducers/copy/basic copy/03/metadata.json +5 -0
- package/test-fixtures/reducers/copy/basic copy/03/source.json +24 -0
- package/test-fixtures/reducers/copy/basic copy/04/base.json +39 -0
- package/test-fixtures/reducers/copy/basic copy/04/merged.json +39 -0
- package/test-fixtures/reducers/copy/basic copy/04/metadata.json +5 -0
- package/test-fixtures/reducers/copy/basic copy/04/source.json +39 -0
- package/test-fixtures/reducers/copy/basic copy/05/base.json +39 -0
- package/test-fixtures/reducers/copy/basic copy/05/merged.json +77 -0
- package/test-fixtures/reducers/copy/basic copy/05/metadata.json +5 -0
- package/test-fixtures/reducers/copy/basic copy/05/source.json +62 -0
- package/test-fixtures/reducers/copy/basic copy/06/base.json +24 -0
- package/test-fixtures/reducers/copy/basic copy/06/merged.json +39 -0
- package/test-fixtures/reducers/copy/basic copy/06/metadata.json +5 -0
- package/test-fixtures/reducers/copy/basic copy/06/source.json +24 -0
- package/test-fixtures/reducers/copy/compareTagsOnly/01/base.json +24 -0
- package/test-fixtures/reducers/copy/compareTagsOnly/01/merged.json +24 -0
- package/test-fixtures/reducers/copy/compareTagsOnly/01/metadata.json +6 -0
- package/test-fixtures/reducers/copy/compareTagsOnly/01/source.json +24 -0
- package/test-fixtures/reducers/copy/compareTagsOnly/02/base.json +24 -0
- package/test-fixtures/reducers/copy/compareTagsOnly/02/merged.json +100 -0
- package/test-fixtures/reducers/copy/compareTagsOnly/02/metadata.json +6 -0
- package/test-fixtures/reducers/copy/compareTagsOnly/02/source.json +100 -0
- package/test-fixtures/reducers/copy/compareWithoutIndicators/01/base.json +24 -0
- package/test-fixtures/reducers/copy/compareWithoutIndicators/01/merged.json +24 -0
- package/test-fixtures/reducers/copy/compareWithoutIndicators/01/metadata.json +6 -0
- package/test-fixtures/reducers/copy/compareWithoutIndicators/01/source.json +24 -0
- package/test-fixtures/reducers/copy/compareWithoutIndicators/02/base.json +24 -0
- package/test-fixtures/reducers/copy/compareWithoutIndicators/02/merged.json +39 -0
- package/test-fixtures/reducers/copy/compareWithoutIndicators/02/metadata.json +6 -0
- package/test-fixtures/reducers/copy/compareWithoutIndicators/02/source.json +24 -0
- package/test-fixtures/reducers/copy/copyUnless/01/base.json +9 -0
- package/test-fixtures/reducers/copy/copyUnless/01/merged.json +24 -0
- package/test-fixtures/reducers/copy/copyUnless/01/metadata.json +6 -0
- package/test-fixtures/reducers/copy/copyUnless/01/source.json +47 -0
- package/test-fixtures/reducers/copy/dropSubfields/01/base.json +35 -0
- package/test-fixtures/reducers/copy/dropSubfields/01/merged.json +54 -0
- package/test-fixtures/reducers/copy/dropSubfields/01/metadata.json +6 -0
- package/test-fixtures/reducers/copy/dropSubfields/01/source.json +43 -0
- package/test-fixtures/reducers/copy/dropSubfields/02/base.json +43 -0
- package/test-fixtures/reducers/copy/dropSubfields/02/merged.json +58 -0
- package/test-fixtures/reducers/copy/dropSubfields/02/metadata.json +6 -0
- package/test-fixtures/reducers/copy/dropSubfields/02/source.json +32 -0
- package/test-fixtures/reducers/copy/dropSubfields/03/base.json +43 -0
- package/test-fixtures/reducers/copy/dropSubfields/03/merged.json +58 -0
- package/test-fixtures/reducers/copy/dropSubfields/03/metadata.json +6 -0
- package/test-fixtures/reducers/copy/dropSubfields/03/source.json +32 -0
- package/test-fixtures/reducers/copy/dropSubfields/04/base.json +43 -0
- package/test-fixtures/reducers/copy/dropSubfields/04/merged.json +43 -0
- package/test-fixtures/reducers/copy/dropSubfields/04/metadata.json +6 -0
- package/test-fixtures/reducers/copy/dropSubfields/04/source.json +32 -0
- package/test-fixtures/reducers/copy/excludeSubfields/01/base.json +39 -0
- package/test-fixtures/reducers/copy/excludeSubfields/01/merged.json +39 -0
- package/test-fixtures/reducers/copy/excludeSubfields/01/metadata.json +9 -0
- package/test-fixtures/reducers/copy/excludeSubfields/01/source.json +43 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/01/base.json +24 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/01/merged.json +39 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/01/metadata.json +6 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/01/source.json +24 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/02/base.json +24 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/02/merged.json +24 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/02/metadata.json +6 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/02/source.json +24 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/03/base.json +28 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/03/merged.json +43 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/03/metadata.json +6 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/03/source.json +24 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/04/base.json +28 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/04/merged.json +28 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/04/metadata.json +6 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/04/source.json +24 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/05/base.json +20 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/05/merged.json +35 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/05/metadata.json +6 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/05/source.json +24 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/06/base.json +20 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/06/merged.json +35 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/06/metadata.json +6 -0
- package/test-fixtures/reducers/copy/subfieldsMustBeIdentical/06/source.json +24 -0
- package/test-fixtures/reducers/metadata.json +5 -0
- package/test-fixtures/reducers/select/01/base.json +21 -0
- package/test-fixtures/reducers/select/01/merged.json +20 -0
- package/test-fixtures/reducers/select/01/metadata.json +5 -0
- package/test-fixtures/reducers/select/01/source.json +20 -0
- package/test-fixtures/reducers/select/02/base.json +31 -0
- package/test-fixtures/reducers/select/02/merged.json +31 -0
- package/test-fixtures/reducers/select/02/metadata.json +4 -0
- package/test-fixtures/reducers/select/02/source.json +42 -0
- package/test-fixtures/reducers/select/03/base.json +20 -0
- package/test-fixtures/reducers/select/03/merged.json +20 -0
- package/test-fixtures/reducers/select/03/metadata.json +4 -0
- package/test-fixtures/reducers/select/03/source.json +20 -0
- package/test-fixtures/reducers/select/04/base.json +20 -0
- package/test-fixtures/reducers/select/04/merged.json +20 -0
- package/test-fixtures/reducers/select/04/metadata.json +5 -0
- package/test-fixtures/reducers/select/04/source.json +20 -0
- package/test-fixtures/reducers/select/05/base.json +24 -0
- package/test-fixtures/reducers/select/05/merged.json +24 -0
- package/test-fixtures/reducers/select/05/metadata.json +4 -0
- package/test-fixtures/reducers/select/05/source.json +24 -0
- package/test-fixtures/reducers/select/06/base.json +28 -0
- package/test-fixtures/reducers/select/06/merged.json +28 -0
- package/test-fixtures/reducers/select/06/metadata.json +4 -0
- package/test-fixtures/reducers/select/06/source.json +28 -0
- package/test-fixtures/reducers/select/07/base.json +24 -0
- package/test-fixtures/reducers/select/07/merged.json +24 -0
- package/test-fixtures/reducers/select/07/metadata.json +5 -0
- package/test-fixtures/reducers/select/07/source.json +24 -0
- package/test-fixtures/reducers/select/08/base.json +24 -0
- package/test-fixtures/reducers/select/08/merged.json +24 -0
- package/test-fixtures/reducers/select/08/metadata.json +4 -0
- package/test-fixtures/reducers/select/08/source.json +24 -0
- package/test-fixtures/reducers/select/09/base.json +24 -0
- package/test-fixtures/reducers/select/09/merged.json +24 -0
- package/test-fixtures/reducers/select/09/metadata.json +4 -0
- package/test-fixtures/reducers/select/09/source.json +24 -0
- package/test-fixtures/reducers/select/10/base.json +24 -0
- package/test-fixtures/reducers/select/10/merged.json +28 -0
- package/test-fixtures/reducers/select/10/metadata.json +5 -0
- package/test-fixtures/reducers/select/10/source.json +28 -0
- package/test-fixtures/reducers/select/11/base.json +24 -0
- package/test-fixtures/reducers/select/11/merged.json +24 -0
- package/test-fixtures/reducers/select/11/metadata.json +4 -0
- package/test-fixtures/reducers/select/11/source.json +28 -0
- package/test-fixtures/reducers/select/12/base.json +24 -0
- package/test-fixtures/reducers/select/12/merged.json +28 -0
- package/test-fixtures/reducers/select/12/metadata.json +5 -0
- package/test-fixtures/reducers/select/12/source.json +28 -0
- package/test-fixtures/reducers/select/13/base.json +28 -0
- package/test-fixtures/reducers/select/13/merged.json +28 -0
- package/test-fixtures/reducers/select/13/metadata.json +4 -0
- package/test-fixtures/reducers/select/13/source.json +24 -0
- package/test-fixtures/reducers/select/14/base.json +24 -0
- package/test-fixtures/reducers/select/14/merged.json +24 -0
- package/test-fixtures/reducers/select/14/metadata.json +4 -0
- package/test-fixtures/reducers/select/14/source.json +24 -0
- package/.editorconfig +0 -10
- package/.istanbul.yml +0 -6
- package/.jshintignore +0 -2
- package/.jshintrc +0 -3
- package/.travis.yml +0 -16
- package/LICENSE.txt +0 -661
- package/karma.conf.js +0 -39
- package/lib/main.js +0 -1215
- package/resources/action-copy-options-schema.json +0 -81
- package/resources/action-select-better-options-schema.json +0 -34
- package/resources/configuration-schema.json +0 -46
- package/test/browser/main.spec.js +0 -96
- package/test/nodejs/main.spec.js +0 -71
- package/test/suites/74.json +0 -10
- package/test/suites/config/1to3.json +0 -10
- package/test/suites/config/27to28.json +0 -10
- package/test/suites/config/29to31.json +0 -10
- package/test/suites/config/32to40.json +0 -16
- package/test/suites/config/41to43.json +0 -10
- package/test/suites/config/44to56.json +0 -15
- package/test/suites/config/4to26.json +0 -81
- package/test/suites/config/57to63.json +0 -63
- package/test/suites/config/64.json +0 -7
- package/test/suites/config/65.json +0 -19
- package/test/suites/config/66.json +0 -13
- package/test/suites/config/67.json +0 -14
- package/test/suites/config/68.json +0 -12
- package/test/suites/config/69.json +0 -12
- package/test/suites/config/70.json +0 -13
- package/test/suites/config/71.json +0 -10
- package/test/suites/config/72.json +0 -12
- package/test/suites/config/73.json +0 -10
- package/test/suites/config/76.json +0 -13
- package/test/suites/config/77.json +0 -11
- package/test/suites/config/78to79.json +0 -12
- package/test/suites/config/80to81.json +0 -12
- package/test/suites/config/82.json +0 -10
- package/test/suites/config/83to85.json +0 -15
- package/test/suites/config/86.json +0 -16
- package/test/suites/config/87.json +0 -15
- package/test/suites/config/88.json +0 -16
- package/test/suites/data/1/merged +0 -3
- package/test/suites/data/1/other +0 -3
- package/test/suites/data/1/preferred +0 -2
- package/test/suites/data/10/descr +0 -1
- package/test/suites/data/10/merged +0 -2
- package/test/suites/data/10/other +0 -2
- package/test/suites/data/10/preferred +0 -2
- package/test/suites/data/11/descr +0 -1
- package/test/suites/data/11/merged +0 -2
- package/test/suites/data/11/other +0 -2
- package/test/suites/data/11/preferred +0 -2
- package/test/suites/data/12/descr +0 -1
- package/test/suites/data/12/merged +0 -2
- package/test/suites/data/12/other +0 -2
- package/test/suites/data/12/preferred +0 -2
- package/test/suites/data/13/descr +0 -1
- package/test/suites/data/13/merged +0 -3
- package/test/suites/data/13/other +0 -2
- package/test/suites/data/13/preferred +0 -3
- package/test/suites/data/14/descr +0 -1
- package/test/suites/data/14/merged +0 -2
- package/test/suites/data/14/other +0 -2
- package/test/suites/data/14/preferred +0 -2
- package/test/suites/data/15/descr +0 -1
- package/test/suites/data/15/merged +0 -2
- package/test/suites/data/15/other +0 -2
- package/test/suites/data/15/preferred +0 -2
- package/test/suites/data/16/descr +0 -1
- package/test/suites/data/16/merged +0 -2
- package/test/suites/data/16/other +0 -2
- package/test/suites/data/16/preferred +0 -2
- package/test/suites/data/17/descr +0 -1
- package/test/suites/data/17/merged +0 -2
- package/test/suites/data/17/other +0 -2
- package/test/suites/data/17/preferred +0 -2
- package/test/suites/data/18/descr +0 -1
- package/test/suites/data/18/merged +0 -2
- package/test/suites/data/18/other +0 -2
- package/test/suites/data/18/preferred +0 -2
- package/test/suites/data/19/descr +0 -1
- package/test/suites/data/19/merged +0 -2
- package/test/suites/data/19/other +0 -2
- package/test/suites/data/19/preferred +0 -2
- package/test/suites/data/2/merged +0 -3
- package/test/suites/data/2/other +0 -2
- package/test/suites/data/2/preferred +0 -3
- package/test/suites/data/20/descr +0 -1
- package/test/suites/data/20/merged +0 -3
- package/test/suites/data/20/other +0 -2
- package/test/suites/data/20/preferred +0 -2
- package/test/suites/data/21/descr +0 -1
- package/test/suites/data/21/merged +0 -4
- package/test/suites/data/21/other +0 -4
- package/test/suites/data/21/preferred +0 -3
- package/test/suites/data/22/descr +0 -1
- package/test/suites/data/22/merged +0 -10
- package/test/suites/data/22/other +0 -7
- package/test/suites/data/22/preferred +0 -10
- package/test/suites/data/23/descr +0 -1
- package/test/suites/data/23/merged +0 -2
- package/test/suites/data/23/other +0 -2
- package/test/suites/data/23/preferred +0 -2
- package/test/suites/data/24/descr +0 -1
- package/test/suites/data/24/merged +0 -2
- package/test/suites/data/24/other +0 -2
- package/test/suites/data/24/preferred +0 -2
- package/test/suites/data/25/descr +0 -1
- package/test/suites/data/25/merged +0 -2
- package/test/suites/data/25/other +0 -2
- package/test/suites/data/25/preferred +0 -2
- package/test/suites/data/26/descr +0 -1
- package/test/suites/data/26/merged +0 -3
- package/test/suites/data/26/other +0 -3
- package/test/suites/data/26/preferred +0 -3
- package/test/suites/data/27/merged +0 -3
- package/test/suites/data/27/other +0 -2
- package/test/suites/data/27/preferred +0 -2
- package/test/suites/data/28/merged +0 -3
- package/test/suites/data/28/other +0 -2
- package/test/suites/data/28/preferred +0 -2
- package/test/suites/data/29/merged +0 -2
- package/test/suites/data/29/other +0 -2
- package/test/suites/data/29/preferred +0 -2
- package/test/suites/data/3/merged +0 -3
- package/test/suites/data/3/other +0 -3
- package/test/suites/data/3/preferred +0 -3
- package/test/suites/data/30/merged +0 -3
- package/test/suites/data/30/other +0 -2
- package/test/suites/data/30/preferred +0 -2
- package/test/suites/data/31/merged +0 -3
- package/test/suites/data/31/other +0 -2
- package/test/suites/data/31/preferred +0 -3
- package/test/suites/data/32/other +0 -2
- package/test/suites/data/32/preferred +0 -3
- package/test/suites/data/33/merged +0 -2
- package/test/suites/data/33/other +0 -2
- package/test/suites/data/33/preferred +0 -2
- package/test/suites/data/34/merged +0 -2
- package/test/suites/data/34/other +0 -2
- package/test/suites/data/34/preferred +0 -2
- package/test/suites/data/35/merged +0 -2
- package/test/suites/data/35/other +0 -2
- package/test/suites/data/35/preferred +0 -2
- package/test/suites/data/36/merged +0 -2
- package/test/suites/data/36/other +0 -2
- package/test/suites/data/36/preferred +0 -2
- package/test/suites/data/37/merged +0 -3
- package/test/suites/data/37/other +0 -2
- package/test/suites/data/37/preferred +0 -2
- package/test/suites/data/38/merged +0 -3
- package/test/suites/data/38/other +0 -2
- package/test/suites/data/38/preferred +0 -2
- package/test/suites/data/39/merged +0 -2
- package/test/suites/data/39/other +0 -2
- package/test/suites/data/39/preferred +0 -2
- package/test/suites/data/4/descr +0 -1
- package/test/suites/data/4/merged +0 -2
- package/test/suites/data/4/other +0 -2
- package/test/suites/data/4/preferred +0 -2
- package/test/suites/data/40/merged +0 -2
- package/test/suites/data/40/other +0 -2
- package/test/suites/data/40/preferred +0 -2
- package/test/suites/data/41/merged +0 -2
- package/test/suites/data/41/other +0 -2
- package/test/suites/data/41/preferred +0 -2
- package/test/suites/data/42/merged +0 -2
- package/test/suites/data/42/other +0 -2
- package/test/suites/data/42/preferred +0 -2
- package/test/suites/data/43/merged +0 -2
- package/test/suites/data/43/other +0 -2
- package/test/suites/data/43/preferred +0 -2
- package/test/suites/data/44/merged +0 -2
- package/test/suites/data/44/other +0 -2
- package/test/suites/data/44/preferred +0 -2
- package/test/suites/data/45/merged +0 -2
- package/test/suites/data/45/other +0 -2
- package/test/suites/data/45/preferred +0 -2
- package/test/suites/data/46/merged +0 -2
- package/test/suites/data/46/other +0 -2
- package/test/suites/data/46/preferred +0 -2
- package/test/suites/data/47/merged +0 -2
- package/test/suites/data/47/other +0 -2
- package/test/suites/data/47/preferred +0 -2
- package/test/suites/data/48/merged +0 -2
- package/test/suites/data/48/other +0 -2
- package/test/suites/data/48/preferred +0 -2
- package/test/suites/data/49/merged +0 -3
- package/test/suites/data/49/other +0 -2
- package/test/suites/data/49/preferred +0 -2
- package/test/suites/data/5/descr +0 -1
- package/test/suites/data/5/merged +0 -2
- package/test/suites/data/5/other +0 -2
- package/test/suites/data/5/preferred +0 -2
- package/test/suites/data/50/merged +0 -3
- package/test/suites/data/50/other +0 -2
- package/test/suites/data/50/preferred +0 -2
- package/test/suites/data/51/merged +0 -3
- package/test/suites/data/51/other +0 -2
- package/test/suites/data/51/preferred +0 -2
- package/test/suites/data/52/merged +0 -2
- package/test/suites/data/52/other +0 -2
- package/test/suites/data/52/preferred +0 -2
- package/test/suites/data/53/merged +0 -3
- package/test/suites/data/53/other +0 -2
- package/test/suites/data/53/preferred +0 -2
- package/test/suites/data/54/merged +0 -3
- package/test/suites/data/54/other +0 -2
- package/test/suites/data/54/preferred +0 -2
- package/test/suites/data/55/merged +0 -3
- package/test/suites/data/55/other +0 -2
- package/test/suites/data/55/preferred +0 -2
- package/test/suites/data/56/merged +0 -2
- package/test/suites/data/56/other +0 -2
- package/test/suites/data/56/preferred +0 -2
- package/test/suites/data/57/descr +0 -1
- package/test/suites/data/57/merged +0 -4
- package/test/suites/data/57/other +0 -4
- package/test/suites/data/57/preferred +0 -4
- package/test/suites/data/58/descr +0 -1
- package/test/suites/data/58/merged +0 -2
- package/test/suites/data/58/other +0 -2
- package/test/suites/data/58/preferred +0 -2
- package/test/suites/data/59/descr +0 -1
- package/test/suites/data/59/merged +0 -2
- package/test/suites/data/59/other +0 -2
- package/test/suites/data/59/preferred +0 -2
- package/test/suites/data/6/descr +0 -1
- package/test/suites/data/6/merged +0 -2
- package/test/suites/data/6/other +0 -3
- package/test/suites/data/6/preferred +0 -2
- package/test/suites/data/60/descr +0 -1
- package/test/suites/data/60/merged +0 -2
- package/test/suites/data/60/other +0 -2
- package/test/suites/data/60/preferred +0 -2
- package/test/suites/data/61/descr +0 -1
- package/test/suites/data/61/merged +0 -2
- package/test/suites/data/61/other +0 -2
- package/test/suites/data/61/preferred +0 -2
- package/test/suites/data/62/descr +0 -1
- package/test/suites/data/62/merged +0 -3
- package/test/suites/data/62/other +0 -2
- package/test/suites/data/62/preferred +0 -2
- package/test/suites/data/63/descr +0 -1
- package/test/suites/data/63/merged +0 -3
- package/test/suites/data/63/other +0 -2
- package/test/suites/data/63/preferred +0 -2
- package/test/suites/data/64/merged +0 -2
- package/test/suites/data/64/other +0 -2
- package/test/suites/data/64/preferred +0 -2
- package/test/suites/data/65/merged +0 -3
- package/test/suites/data/65/other +0 -2
- package/test/suites/data/65/preferred +0 -2
- package/test/suites/data/66/merged +0 -2
- package/test/suites/data/66/other +0 -2
- package/test/suites/data/66/preferred +0 -2
- package/test/suites/data/67/merged +0 -2
- package/test/suites/data/67/other +0 -2
- package/test/suites/data/67/preferred +0 -2
- package/test/suites/data/68/merged +0 -2
- package/test/suites/data/68/other +0 -2
- package/test/suites/data/68/preferred +0 -2
- package/test/suites/data/69/merged +0 -2
- package/test/suites/data/69/other +0 -2
- package/test/suites/data/69/preferred +0 -2
- package/test/suites/data/7/descr +0 -1
- package/test/suites/data/7/merged +0 -4
- package/test/suites/data/7/other +0 -3
- package/test/suites/data/7/preferred +0 -3
- package/test/suites/data/70/merged +0 -2
- package/test/suites/data/70/other +0 -2
- package/test/suites/data/70/preferred +0 -2
- package/test/suites/data/71/merged +0 -3
- package/test/suites/data/71/other +0 -2
- package/test/suites/data/71/preferred +0 -2
- package/test/suites/data/72/merged +0 -5
- package/test/suites/data/72/other +0 -2
- package/test/suites/data/72/preferred +0 -4
- package/test/suites/data/73/merged +0 -3
- package/test/suites/data/73/other +0 -3
- package/test/suites/data/73/preferred +0 -3
- package/test/suites/data/74/1/merged +0 -3
- package/test/suites/data/74/1/other +0 -3
- package/test/suites/data/74/1/preferred +0 -2
- package/test/suites/data/74/merged +0 -4
- package/test/suites/data/74/other +0 -4
- package/test/suites/data/74/preferred +0 -2
- package/test/suites/data/75/74/1/merged +0 -3
- package/test/suites/data/75/74/1/other +0 -3
- package/test/suites/data/75/74/1/preferred +0 -2
- package/test/suites/data/75/74/merged +0 -4
- package/test/suites/data/75/74/other +0 -4
- package/test/suites/data/75/74/preferred +0 -2
- package/test/suites/data/75/merged +0 -4
- package/test/suites/data/75/other +0 -3
- package/test/suites/data/75/preferred +0 -2
- package/test/suites/data/76/merged +0 -2
- package/test/suites/data/76/other +0 -2
- package/test/suites/data/76/preferred +0 -2
- package/test/suites/data/77/descr +0 -1
- package/test/suites/data/77/merged +0 -2
- package/test/suites/data/77/other +0 -2
- package/test/suites/data/77/preferred +0 -2
- package/test/suites/data/78/merged +0 -3
- package/test/suites/data/78/other +0 -2
- package/test/suites/data/78/preferred +0 -2
- package/test/suites/data/79/merged +0 -2
- package/test/suites/data/79/other +0 -2
- package/test/suites/data/79/preferred +0 -2
- package/test/suites/data/8/descr +0 -1
- package/test/suites/data/8/merged +0 -3
- package/test/suites/data/8/other +0 -3
- package/test/suites/data/8/preferred +0 -3
- package/test/suites/data/80/merged +0 -3
- package/test/suites/data/80/other +0 -2
- package/test/suites/data/80/preferred +0 -2
- package/test/suites/data/81/merged +0 -2
- package/test/suites/data/81/other +0 -2
- package/test/suites/data/81/preferred +0 -2
- package/test/suites/data/82/merged +0 -2
- package/test/suites/data/82/other +0 -2
- package/test/suites/data/82/preferred +0 -2
- package/test/suites/data/83/merged +0 -2
- package/test/suites/data/83/other +0 -2
- package/test/suites/data/83/preferred +0 -1
- package/test/suites/data/84/merged +0 -2
- package/test/suites/data/84/other +0 -2
- package/test/suites/data/84/preferred +0 -1
- package/test/suites/data/85/merged +0 -2
- package/test/suites/data/85/other +0 -2
- package/test/suites/data/85/preferred +0 -2
- package/test/suites/data/86/merged +0 -2
- package/test/suites/data/86/other +0 -2
- package/test/suites/data/86/preferred +0 -1
- package/test/suites/data/87/merged +0 -2
- package/test/suites/data/87/other +0 -2
- package/test/suites/data/87/preferred +0 -1
- package/test/suites/data/88/merged +0 -2
- package/test/suites/data/88/other +0 -2
- package/test/suites/data/88/preferred +0 -1
- package/test/suites/data/9/descr +0 -1
- package/test/suites/data/9/merged +0 -2
- package/test/suites/data/9/other +0 -2
- package/test/suites/data/9/preferred +0 -2
- package/test/test.js +0 -1001
package/.drone.yml
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: pipeline
|
|
3
|
+
type: docker
|
|
4
|
+
name: Default
|
|
5
|
+
|
|
6
|
+
trigger:
|
|
7
|
+
event:
|
|
8
|
+
- push
|
|
9
|
+
- tag
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
|
|
13
|
+
- name: audit
|
|
14
|
+
image: node:12
|
|
15
|
+
commands:
|
|
16
|
+
- npm audit --package-lock-only --production --audit-level=moderate
|
|
17
|
+
|
|
18
|
+
- name: install
|
|
19
|
+
image: node:12
|
|
20
|
+
environment:
|
|
21
|
+
NPM_CONFIG_IGNORE_SCRIPTS: true
|
|
22
|
+
commands:
|
|
23
|
+
- npm install --no-optional
|
|
24
|
+
|
|
25
|
+
- name: test
|
|
26
|
+
image: node:12
|
|
27
|
+
commands:
|
|
28
|
+
- npm test
|
|
29
|
+
|
|
30
|
+
- name: check-coverage
|
|
31
|
+
image: node:12
|
|
32
|
+
commands:
|
|
33
|
+
- npm run coverage
|
|
34
|
+
|
|
35
|
+
- name: build
|
|
36
|
+
image: node:12
|
|
37
|
+
commands:
|
|
38
|
+
- npm run build
|
|
39
|
+
- NPM_CONFIG_IGNORE_SCRIPTS=false npm ci --production
|
|
40
|
+
|
|
41
|
+
- name: static-security-scan
|
|
42
|
+
image: quay.io/natlibfi/njsscan
|
|
43
|
+
commands:
|
|
44
|
+
- njsscan dist
|
|
45
|
+
|
|
46
|
+
- name: npm
|
|
47
|
+
image: plugins/npm
|
|
48
|
+
settings:
|
|
49
|
+
registry: 'https://registry.npmjs.org/'
|
|
50
|
+
token:
|
|
51
|
+
from_secret: npm_token
|
|
52
|
+
when:
|
|
53
|
+
event: tag
|
|
54
|
+
---
|
|
55
|
+
kind: pipeline
|
|
56
|
+
type: docker
|
|
57
|
+
name: Update dependencies
|
|
58
|
+
|
|
59
|
+
trigger:
|
|
60
|
+
event:
|
|
61
|
+
- custom
|
|
62
|
+
branch:
|
|
63
|
+
- master
|
|
64
|
+
|
|
65
|
+
steps:
|
|
66
|
+
|
|
67
|
+
- name: publish
|
|
68
|
+
image: quay.io/natlibfi/drone-npm-git-publish
|
|
69
|
+
settings:
|
|
70
|
+
git_user_name: natlibfi-melinda-automation
|
|
71
|
+
git_user_email: 65649125+natlibfi-melinda-automation@users.noreply.github.com
|
|
72
|
+
git_ssh_key:
|
|
73
|
+
from_secret: ssh_key
|
|
74
|
+
git_gpg_key:
|
|
75
|
+
from_secret: gpg_key
|
|
76
|
+
---
|
|
77
|
+
kind: secret
|
|
78
|
+
name: npm_token
|
|
79
|
+
data: IB5vm9V6fNh9O1FFF9rv2eBMNy+WiZpxjfNhlq9DIX5wDYXXY1Xk64llB1YwDXiBqJDW2kIjAIc8vXG+xU3jmw==
|
|
80
|
+
---
|
|
81
|
+
kind: secret
|
|
82
|
+
name: ssh_key
|
|
83
|
+
data: ow0lyiEy3STIADta5Cg7MMQ9Xm/JbNJn5CNrlQr+Kxf9dZQgKvGPHayQJydSajIYB5FrAB+CWvU23qIUPc1ooxQcsvil2GkhNiJ87cqb1uLWQmGY/cXA2PlaOFIt97EzPeMGqarXMKp8a8VW/LA0cmq4DnpTBzl2aVKRHQxycO6j5cEG6OQeJ32K94nRnzUFFMnowuOqauQAe5T6n5lEgASO5oIs9OK/oCZ9byJ3i7iGE3+7ebJgnpTClEuS2MeAhO3j1hXbQZTApXZ6D/d5Hea/MFYShGkabQBP+D5WBfPxwTiadRDJ52qbwti0d+lloQrDhxWCM7b66/wLGDiqH+5SE0ERxnkRhwFYUPgDaF0mq+dSfRuH3m1KvCwYb+2TWrIbnnof+s1ICsZMwL6mlcrUvFuocXC1qbiHfcfEPa3YZFm7CmL/4u102vzKnX4ztNWYxfndPTK9rYDAK2D+lXGe2VfpHp7HwOeTWyqkZ7FLGhnyggdUiJY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DN0OE9zj7fknm9/WzmIbAsLuE1PBskH+W3S+3mjlLulBdyaDI+72tU/qVTJDILmzBkJ14ScBqy5NRlv4+y7DePluPMMTR/k/+r8ub1n8n97nuXbDqLmMOKwxbZKG2VcQDzF6tDhagb8QuTu4dczF2reHvDv6yimQ0+yGX3ND5Ga9n63+VPpXKrDx+9r0LSFSYAUtHdzLDy+jEGS6FGGJM0FzRb6tTpYDOnEQV8T5XLfbH0FZO1Rl20XSvPyrUX8ArxCwTUs8REj58nmm7Mwr7zDv8Zm+7vlIaPHHgnwNEyjUeKubZT0hwP07QHmPVvm03k0pbCltB8AICf40LPAxXQu6yLI9lFrqFcTGgeRiphbXfZqKv4QJ8/IL1/lPAlkyKeiXW0syci3a25oH6CKKCYkcwr2793pkKa3WHXH5ZNivWwdgNfKkp3gjt4nNV5qGpPKCUWKfFAjNiZw9PHEYQ2OKz9LxoKBYIa9vGxxGL2RbHAMgsi28pSpIgD6G2fNuVhbW73wfOVMcNVGk9EQkFBA7rIj6LKQL6DR9oJ9kywRzzScwGqmXxEw02gDfHl5iEP5tz1fMs8o8G0OvkM9yf1WNkr9YNswpAgCTtXmwffaBFiZP54Tg5nvHLks3X/84PPnQ==
|
|
88
|
+
---
|
|
89
|
+
kind: signature
|
|
90
|
+
hmac: 4815f1484dffe80b54c0a0132b742f0976a7689354e933ba220c5b30835708c0
|
|
91
|
+
|
|
92
|
+
...
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# With this line @NatLibFi/melinda-js-lead owns any files in the /.github/
|
|
2
|
+
# directory at the root of the repository and any of its
|
|
3
|
+
# subdirectories.
|
|
4
|
+
/.github/ @NatLibFi/melinda-js-lead
|
|
5
|
+
|
|
6
|
+
# With this line @NatLibFi/melinda-js-lead owns any files in the /src/
|
|
7
|
+
# directory at the root of the repository and any of its
|
|
8
|
+
# subdirectories.
|
|
9
|
+
/src/ @NatLibFi/melinda-js-lead
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# NatLibFi/Melinda maintenance strategy
|
|
2
|
+
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
updates:
|
|
6
|
+
# Maintain dependencies for GitHub Actions
|
|
7
|
+
- package-ecosystem: "github-actions"
|
|
8
|
+
directory: "/"
|
|
9
|
+
schedule:
|
|
10
|
+
interval: "daily"
|
|
11
|
+
time: "06:30"
|
|
12
|
+
timezone: "Europe/Helsinki"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# Minor updates to npm production dependencies daily
|
|
16
|
+
- package-ecosystem: "npm"
|
|
17
|
+
directory: "/"
|
|
18
|
+
schedule:
|
|
19
|
+
interval: "daily"
|
|
20
|
+
time: "06:45"
|
|
21
|
+
timezone: "Europe/Helsinki"
|
|
22
|
+
versioning-strategy: lockfile-only
|
|
23
|
+
labels:
|
|
24
|
+
- "npm minor dependencies"
|
|
25
|
+
allow:
|
|
26
|
+
- dependency-type: "production"
|
|
27
|
+
|
|
28
|
+
# Major updates to npm dependencies weekly @tuesday
|
|
29
|
+
# Not possible yet https://github.com/dependabot/dependabot-core/issues/1778
|
|
30
|
+
# - package-ecosystem: "npm"
|
|
31
|
+
# directory: "/"
|
|
32
|
+
# schedule:
|
|
33
|
+
# interval: "weekly"
|
|
34
|
+
# day: "tuesday"
|
|
35
|
+
# time: "07:00"
|
|
36
|
+
# timezone: "Europe/Helsinki"
|
|
37
|
+
# versioning-strategy: increase-if-necessary
|
|
38
|
+
# labels:
|
|
39
|
+
# - "npm major dependencies"
|
|
40
|
+
# reviewers:
|
|
41
|
+
# - "natlibfi/melinda-js-lead"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Melinda node tests
|
|
2
|
+
|
|
3
|
+
name: Melinda node tests
|
|
4
|
+
|
|
5
|
+
on: push
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build-node-versions:
|
|
9
|
+
name: Node version matrix
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
node-version: [14.x, 16.x, 18.x]
|
|
15
|
+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout the code
|
|
19
|
+
uses: actions/checkout@v3
|
|
20
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
21
|
+
uses: actions/setup-node@v2
|
|
22
|
+
with:
|
|
23
|
+
node-version: ${{ matrix.node-version }}
|
|
24
|
+
cache: 'npm'
|
|
25
|
+
env:
|
|
26
|
+
NPM_CONFIG_IGNORE_SCRIPTS: true
|
|
27
|
+
- run: npm audit --package-lock-only --production --audit-level=moderate
|
|
28
|
+
- run: npm ci
|
|
29
|
+
- run: npm test
|
|
30
|
+
- run: npm run build --if-present
|
|
31
|
+
|
|
32
|
+
njsscan:
|
|
33
|
+
name: Njsscan check
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
|
|
36
|
+
steps:
|
|
37
|
+
- name: Checkout the code
|
|
38
|
+
uses: actions/checkout@v3
|
|
39
|
+
- name: nodejsscan scan
|
|
40
|
+
id: njsscan
|
|
41
|
+
uses: ajinabraham/njsscan-action@master
|
|
42
|
+
with:
|
|
43
|
+
args: '.'
|
|
44
|
+
|
|
45
|
+
publish:
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
needs: [build-node-versions, njsscan]
|
|
48
|
+
if: contains(github.ref, 'refs/tags/')
|
|
49
|
+
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v3
|
|
52
|
+
# Setup .npmrc file to publish to npm
|
|
53
|
+
- uses: actions/setup-node@v3
|
|
54
|
+
with:
|
|
55
|
+
node-version: '14.x'
|
|
56
|
+
registry-url: 'https://registry.npmjs.org'
|
|
57
|
+
- run: npm ci
|
|
58
|
+
- run: npm publish
|
|
59
|
+
env:
|
|
60
|
+
NODE_AUTH_TOKEN: ${{ secrets.MARC_RECORD_MERGE_JS_NPM_TOKEN }}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-current University of Helsinki (National Library of Finland)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,283 +1,101 @@
|
|
|
1
|
-
# MARC
|
|
1
|
+
# Merge MARC records [](https://npmjs.org/package/@natlibfi/marc-record-merge)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Merge MARC records
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
Clone the sources and install the package (In the source directory) on command line using `npm`:
|
|
5
|
+
## Usage
|
|
6
|
+
### COPY
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
npm install
|
|
8
|
+
Chosing fields for reducer:
|
|
11
9
|
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
npm run check
|
|
20
|
-
|
|
10
|
+
const copyReducerConfigs = [
|
|
11
|
+
{tagPattern: /010/u},
|
|
12
|
+
{tagPattern: /010|020/u},
|
|
13
|
+
{tagPattern: new RegExp('010', 'u')},
|
|
14
|
+
{tagPattern: new RegExp(String((/^(?<tags1>010|020$)/u').source))},
|
|
15
|
+
]
|
|
21
16
|
```
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
### compareTagsOnly (Defaults false)
|
|
25
19
|
```
|
|
26
|
-
|
|
27
|
-
npm run test-browser
|
|
20
|
+
{tagPattern: /010/u, compareTagsOnly: false}
|
|
28
21
|
```
|
|
29
22
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
The module returns a factory function that takes configuration object as the first (mandatory) argument. The second argument (optional) is an object specifying plugin functions. The factory returns a function that takes two MARC records (Instances of [marc-record-js](https://github.com/petuomin/marc-record-js)) as arguments. The first one is the preferred record which will be used as a base records (All fields are taken from this record unless otherwise specified).
|
|
23
|
+
If base has field with that tag source field is ignored
|
|
33
24
|
|
|
34
|
-
###
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
record_merged = mergeRecords(record_preferred, record_other);
|
|
25
|
+
### compareWithoutIndicators (Defaults false)
|
|
26
|
+
```
|
|
27
|
+
{tagPattern: /010/u, compareWithoutIndicators: false}
|
|
38
28
|
```
|
|
39
29
|
|
|
40
|
-
|
|
41
|
-
```js
|
|
42
|
-
define(['marc-record-merge'], function(mergeFactory) {
|
|
43
|
-
|
|
44
|
-
var mergeRecords = mergeFactory(config),
|
|
45
|
-
record_merged = mergeRecords(record_preferred, record_other);
|
|
30
|
+
When base and source fields are compared, indicator differences are ignored
|
|
46
31
|
|
|
47
|
-
|
|
32
|
+
### subfieldsMustBeIdentical (Defaults true)
|
|
48
33
|
```
|
|
49
|
-
|
|
50
|
-
### Browser globals
|
|
51
|
-
```js
|
|
52
|
-
var mergeRecords = mergeMarcRecordsFactory(config),
|
|
53
|
-
record_merged = mergeRecords(record_preferred, record_other);
|
|
34
|
+
{tagPattern: /010/u, subfieldsMustBeIdentical: true}
|
|
54
35
|
```
|
|
55
36
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"actions": [
|
|
70
|
-
{
|
|
71
|
-
"formats": ["BK", "CF", "CR", "MU", "MX", "VM", "MP"],
|
|
72
|
-
"range": [15, 17],
|
|
73
|
-
"significantCaret": false,
|
|
74
|
-
"type": "selectNonEmpty"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"formats": ["BK", "CF", "CR", "MU", "MX", "VM", "MP"],
|
|
78
|
-
"range": [35, 37],
|
|
79
|
-
"significantCaret": false,
|
|
80
|
-
"type": "selectNonEmpty"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"formats": ["BK"],
|
|
84
|
-
"range": [18, 21],
|
|
85
|
-
"significantCaret": true,
|
|
86
|
-
"type": "combine"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"formats": ["BK"],
|
|
90
|
-
"range": [29, 29],
|
|
91
|
-
"significantCaret": false,
|
|
92
|
-
"type": "selectNonEmpty"
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
"7..": {
|
|
98
|
-
"action": "copy",
|
|
99
|
-
"options": {
|
|
100
|
-
"compareWithoutIndicators": true
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
37
|
+
If source subfields are subset of base subfields this option says if it is copied
|
|
38
|
+
| subfieldsMustBeIdentical | base | source | copy |
|
|
39
|
+
|--------------------------|-------------|-------------|-------|
|
|
40
|
+
| true or false | a$foo | a$foo | false |
|
|
41
|
+
| true or false | a$foo | b$bar | true |
|
|
42
|
+
| true | a$foo | a$foo,b$bar | true |
|
|
43
|
+
| false | a$foo | a$foo,b$bar | true |
|
|
44
|
+
| true | a$foo,b$bar | a$foo | true |
|
|
45
|
+
| false | a$foo,b$bar | a$foo | false |
|
|
46
|
+
|
|
47
|
+
### excludeSubfields (Defaults [ ])
|
|
48
|
+
```
|
|
49
|
+
{tagPattern: /010/u, excludeSubfields: ['a']}
|
|
108
50
|
```
|
|
109
51
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
The specified action is executed for each field in the other record that matches the field tag pattern.
|
|
113
|
-
|
|
114
|
-
### Predefined actions
|
|
115
|
-
|
|
116
|
-
**controlfield**: Copy missing control fields from the other record.
|
|
117
|
-
|
|
118
|
-
**mergeControlfield**: Merge controlfields. The rules are set using options:
|
|
119
|
-
- _**formats**_: Array of formats to apply the rule. Available formats: `["BK", "CF", "CR", "MU", "MX", "VM", "MP"]`
|
|
120
|
-
- _**range**_: character range of the controlfield fragment (start, end). One character range requires same number in both.
|
|
121
|
-
- _**significantCaret**_: whether the ^ is significant or not.
|
|
122
|
-
- _**type**_: either `combine` or `selectNonEmpty`. `selectNonEmpty` selects value from preferred, or if it's missing the from other. `combine` merges and sorts values from both fragments.
|
|
123
|
-
|
|
124
|
-
**copy**: Copy fields from other record. The following options are supported:
|
|
125
|
-
|
|
126
|
-
- _**mustBeIdentical**_: A boolean determing whether all subfields must be identical
|
|
127
|
-
- _**compareWithoutIndicators**_: A boolean determing whether field indicators must be identical
|
|
128
|
-
- _**compareWithout**_: An array of subfield codes. These subfields are filtered out from the comparison
|
|
129
|
-
- _**compareSubfieldsNormalized**_: A boolean determing whether the subfields included in _compareWithout_ should be compared as normalized
|
|
130
|
-
- _**combine**_: An array of subfields codes. These subfields will be combined into a single subfield
|
|
131
|
-
- _**dropOriginal**_: Drop matching original field taken from preferred record.
|
|
132
|
-
- _**copyIf/copyUnless**_: Object with subfields as keys containing conditions for copying. Each condition are defined as follows:
|
|
133
|
-
- _**value**_: Required value for subfield
|
|
134
|
-
- _**comparator**_: A subfield comparator function name
|
|
135
|
-
- _**pick**_: Include subfields from the field that is not preserved.
|
|
136
|
-
- _**subfields**_: An array of subfield codes (*Mandatory*)
|
|
137
|
-
- _**missingOnly**_: A boolean determing whether only subfields missing from the target field should be picked
|
|
138
|
-
- _**reduce**_: Drop defined subfield from other record
|
|
139
|
-
- _**subfields**_: An array of subfield codes (*Mandatory*)
|
|
140
|
-
- _**condition**_: Condition used to determine if field should be dropped. If undefined drops all subfields of type. Possible values _if_ and _unless_.
|
|
141
|
-
- _**value**_: Value for comparison. Can be regular expression if exact is option is not set.
|
|
142
|
-
- _**exact**_: If set requires subfield value match exactly. Defaults to false.
|
|
143
|
-
- _**transformOnInequality**_: An object describing how to transform an inequal field. For this option to take effect the preferred record must have at least one field with the same tag name as the other record. The following properties are supported:
|
|
144
|
-
- _**tag**_: Tag name of the new field (*Mandatory*)
|
|
145
|
-
- _**drop**_: An array of subfields codes. These subfields are not included in the new field.
|
|
146
|
-
- _**add**_: An object with subfield codes as keys and subfield values as values.
|
|
147
|
-
- _**map**_: An object with new subfield codes as keys and the old subfield codes as values.
|
|
148
|
-
|
|
149
|
-
The action copies only fields that have no match in the preferred record:
|
|
150
|
-
|
|
151
|
-
1. Attempt to find a corresponding field from preferred record
|
|
152
|
-
1. Attempt to find an identical field (All options are applied to comparison)
|
|
153
|
-
- [Normalize fields](#field-normalization)
|
|
154
|
-
- Tag names must be identical
|
|
155
|
-
- Indicators must be identical
|
|
156
|
-
- Values must be identical
|
|
157
|
-
1. Variable fields: Each subfield must have a matching subfield in the opposite record (Code and value identical).
|
|
158
|
-
1. Control fields: The values must be identical
|
|
159
|
-
1. Attempt to find a similar field if an identical field was not found (All options are applied to comparison)
|
|
160
|
-
- [Normalize fields](#field-normalization)
|
|
161
|
-
- Tag names must be identical
|
|
162
|
-
- Indicators must be identical
|
|
163
|
-
- Values comparison
|
|
164
|
-
1. Variable fields: Either field's subfields must be a subset of the opposite subfields (There is a match for all of the opposite field's subfields)
|
|
165
|
-
1. Control fields: The values must be identical
|
|
166
|
-
1. Copy or do nothing
|
|
167
|
-
1. No corresponding field was found
|
|
168
|
-
1. If no fields in the preferred record with the same tag name were found, copy the field
|
|
169
|
-
1. If fields with the same tag were found and option *transformOnInequality* is enabled, copy the other field using the specified transformations. Otherwise do nothing.
|
|
170
|
-
|
|
171
|
-
1. Corresponding field was found. Check if the other field is deemed different and should be copied to the merged record (All options are applied to comparison)
|
|
172
|
-
1. [Normalize fields](#field-normalization)
|
|
173
|
-
1. Check if the other field is a "proper" subset of the preferred field (Preferred field contains all of the other field's subfields and more)
|
|
174
|
-
1. If it is, copy the field
|
|
175
|
-
1. If it's not, keep the preferred field
|
|
176
|
-
1. In both cases, merge the subfields that were not included in comparison by removing identical subfields
|
|
177
|
-
|
|
178
|
-
**selectBetter**: Selects the **"better"** of the two fields of each record. Cannot be used if the tag has multiple fields. The following options are supported:
|
|
179
|
-
|
|
180
|
-
- _**requireFieldInBoth**_: A boolean determing whether the field must exist in both records to make changes
|
|
181
|
-
- _**onlyIfMissing**_: A boolean determing whether the field will be selected from the other record only if it missing from preferred record
|
|
182
|
-
- _**skipOnMultiple**_: A boolean determing whether to skip the action (And keep the preferred fields) if the are multiple fields of the same tag. Default behavior is to fail the processing
|
|
183
|
-
- _**pick**_: Include subfields from the field that is not preserved.
|
|
184
|
-
- _**subfields**_: An array of subfield codes (*Mandatory*)
|
|
185
|
-
- _**missingOnly**_: A boolean determing whether only subfields missing from the target field should be picked
|
|
186
|
-
- _**comparator**_: A subfield comparator function name
|
|
187
|
-
|
|
188
|
-
The better field is selected as follows:
|
|
189
|
-
|
|
190
|
-
1. [Normalize fields](#field-normalization)
|
|
191
|
-
1. Check if both fields' subfields are considered equal (Using the comparator function)
|
|
192
|
-
1. If equal, select the field that gets the most points (Fields get points for each subfield that has more characters than the corresponding subfield in the opposite field)
|
|
193
|
-
1. If not equal, check if the other field is a "proper" subset of the preferred field (Preferred field contains all of the other field's subfields and more)
|
|
194
|
-
1. If the other field is a subset of the preferred field, select the other field
|
|
195
|
-
1. Otherwise select the preferred field
|
|
196
|
-
|
|
197
|
-
**createFrom**: Creates new field based on field other record. The following options are supported:
|
|
198
|
-
- _**convertTag**_: Converts field tag to another.
|
|
199
|
-
- _**ind[1-2]**_: Converts indicator in created field.
|
|
200
|
-
- _**skipIfExists**_: Skip creating new field if target field is found in preferred.
|
|
201
|
-
- _**useExisting**_: Use existing field from preferred as base copying all subrecords.
|
|
202
|
-
- _**keepExisting**_: Keep existing field from preferred and create new field.
|
|
203
|
-
- _**subfields**_: Object of subfields as keys to be included in created field. Each subfield object can have following properties:
|
|
204
|
-
- _**convertCode**_: Converts subfield code to another.
|
|
205
|
-
- _**convertValue**_: Converts value to another.
|
|
206
|
-
- _**append**_: Append value to existing subfield. If subfield does not exists create as new.
|
|
207
|
-
- _**replace**_: Replace existing subfield.
|
|
208
|
-
- _**modifications**_: Array of modifications for value. Can be either function or following object:
|
|
209
|
-
- _**type**_: Type of operation. Possible values are: _copy_, _replace_, _wrap_, _prepend_, _append_
|
|
210
|
-
- _**args**_: Array of arguments for operation
|
|
211
|
-
|
|
212
|
-
If subfield object is empty subfield is copied as is.
|
|
213
|
-
|
|
214
|
-
## Field normalization
|
|
215
|
-
|
|
216
|
-
Field values (Variable field subfields or control field value) are normalized as follows:
|
|
217
|
-
|
|
218
|
-
1. String is converted to lower case
|
|
219
|
-
1. Punctuation (See the function _**removePunctuation**_ in [lib/main.js](https://github.com/NatLibFi/marc-record-merge/blob/master/lib/main.js) for the characters replaced) is replaced with whitespace. The resulting string is trimmed (Whitespace removed from both ends) and subsequent whitespace is reduced to single whitespace.
|
|
220
|
-
1. Diacritics are replaced with their corresponding ASCII characters (See the variable __*DIACRITICS_REMOVAL_MAP*__ in [lib/main.js](https://github.com/NatLibFi/marc-record-merge/blob/master/lib/main.js) for mapping)
|
|
52
|
+
When base and source fields are compared, excluded subfields are ignored
|
|
221
53
|
|
|
222
|
-
|
|
54
|
+
### dropSubfields (Defaults [ ])
|
|
55
|
+
```
|
|
56
|
+
{tagPattern: /010/u, dropSubfields: [{"code": "9"}]}
|
|
57
|
+
```
|
|
58
|
+
Drops subfields 9's from all fields tagged 010
|
|
223
59
|
|
|
224
|
-
|
|
225
|
-
|
|
60
|
+
```
|
|
61
|
+
{tagPattern: /010/u, dropSubfields: [{"code": "9", "value": "FENNI<KEEP>"}]}
|
|
62
|
+
```
|
|
63
|
+
Drops subfields 9's that have "FENNI<KEEP>" from all fields tagged 010
|
|
226
64
|
|
|
227
|
-
### Plugins
|
|
228
65
|
|
|
229
|
-
|
|
66
|
+
```
|
|
67
|
+
{tagPattern: /010/u, dropSubfields: [{"code": "9", "condition": "unless", "value": "^FENNI<(?<option>KEEP|PASS)>$"}]}
|
|
68
|
+
```
|
|
69
|
+
Drops all subfield 9's unless they have "FENNI<KEEP>" or "FENNI<PASS>" from all fields tagged 010
|
|
230
70
|
|
|
231
|
-
#### actions
|
|
232
71
|
|
|
233
|
-
|
|
72
|
+
When comparing or copying field dropped fields are ignored
|
|
234
73
|
|
|
235
|
-
|
|
236
|
-
|
|
74
|
+
### copyUnless (Defaults [ ])
|
|
75
|
+
```
|
|
76
|
+
{tagPattern: /010/u, copyUnless: [{"code": "9", "value": "FENNI<KEEP>"}]}
|
|
237
77
|
```
|
|
238
|
-
**Parameters:**
|
|
239
|
-
- *record_merge*: The merged record which is to be modified (Based on the preferred record)
|
|
240
|
-
- *field_other*: The field from the other record which is the subject of the action
|
|
241
|
-
- *options*: Action specific options
|
|
242
|
-
- *return_details*: If this is defined, return action specific details about processing
|
|
243
|
-
|
|
244
|
-
The function's return value is not used unless *return_detail* is defined.
|
|
245
|
-
|
|
246
|
-
#### comparators
|
|
247
78
|
|
|
248
|
-
|
|
79
|
+
When field is otherwise ok to be copied, if it contains given subfield whole field is ignored
|
|
249
80
|
|
|
250
|
-
|
|
251
|
-
|
|
81
|
+
### baseValidators (Defaults {subfieldValues: false})
|
|
82
|
+
```
|
|
83
|
+
{tagPattern: /010/u, baseValidators: {fields: true, subfields: true, subfieldValues: true}}
|
|
252
84
|
```
|
|
253
85
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
By default, new fields are added after the similar fields. This can be changed with the **sort** property:
|
|
86
|
+
Marc record validators for base record while reducer is working.
|
|
87
|
+
More info can be read here: https://github.com/NatLibFi/marc-record-js
|
|
257
88
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
"020": {
|
|
262
|
-
"action": "copy"
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
"sort": {
|
|
266
|
-
"insert": "before",
|
|
267
|
-
"indexes": {
|
|
268
|
-
"CAT": 995
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
89
|
+
### sourceValidators (Defaults {subfieldValues: false})
|
|
90
|
+
```
|
|
91
|
+
{tagPattern: /010/u, sourceValidators: {fields: true, subfields: true, subfieldValues: true}}
|
|
272
92
|
```
|
|
273
93
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
- **indexes**: An object with field tag patterns as keys and static sort indexes as values. By default, new fields are inserted by the tag's numeric index (If similar fields don't exist)
|
|
94
|
+
Marc record validators for source record while reducer is working.
|
|
95
|
+
More info can be read here: https://github.com/NatLibFi/marc-record-js
|
|
277
96
|
|
|
278
97
|
## License and copyright
|
|
279
98
|
|
|
280
|
-
Copyright (c)
|
|
281
|
-
|
|
99
|
+
Copyright (c) 2020-2022 **University Of Helsinki (The National Library Of Finland)**
|
|
282
100
|
|
|
283
|
-
This project's source code is licensed under the terms of **
|
|
101
|
+
This project's source code is licensed under the terms of **MIT** or any later version.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Reducers", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _reducers.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
exports.default = void 0;
|
|
13
|
+
|
|
14
|
+
var _reducers = _interopRequireDefault(require("./reducers"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
var _default = ({
|
|
19
|
+
base,
|
|
20
|
+
source,
|
|
21
|
+
reducers
|
|
22
|
+
}) => reducers.reduce((base, reducer) => reducer(base, source), base);
|
|
23
|
+
|
|
24
|
+
exports.default = _default;
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["base","source","reducers","reduce","reducer"],"sources":["../src/index.js"],"sourcesContent":["import Reducers from './reducers';\n\nexport {Reducers};\nexport default ({base, source, reducers}) => reducers.reduce((base, reducer) => reducer(base, source), base);\n"],"mappings":";;;;;;;;;;;;;AAAA;;;;eAGe,CAAC;EAACA,IAAD;EAAOC,MAAP;EAAeC;AAAf,CAAD,KAA8BA,QAAQ,CAACC,MAAT,CAAgB,CAACH,IAAD,EAAOI,OAAP,KAAmBA,OAAO,CAACJ,IAAD,EAAOC,MAAP,CAA1C,EAA0DD,IAA1D,C"}
|