@natlibfi/marc-record-validators-melinda 3.2.0 → 3.3.14-alpha.2
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/.github/CODEOWNERS +2 -0
- package/.github/dependabot.yml +40 -0
- package/.github/workflows/melinda-node-tests.yml +61 -0
- package/LICENSE.txt +21 -661
- package/README.md +4 -5
- package/dist/access-rights.js +94 -0
- package/dist/access-rights.js.map +1 -0
- package/dist/access-rights.spec.js +150 -0
- package/dist/access-rights.spec.js.map +1 -0
- package/dist/double-commas.js +17 -27
- package/dist/double-commas.js.map +1 -1
- package/dist/double-commas.spec.js +72 -27
- package/dist/double-commas.spec.js.map +1 -1
- package/dist/duplicates-ind1.js +47 -27
- package/dist/duplicates-ind1.js.map +1 -1
- package/dist/duplicates-ind1.spec.js +44 -27
- package/dist/duplicates-ind1.spec.js.map +1 -1
- package/dist/empty-fields.js +79 -29
- package/dist/empty-fields.js.map +1 -1
- package/dist/empty-fields.spec.js +113 -27
- package/dist/empty-fields.spec.js.map +1 -1
- package/dist/ending-punctuation-conf.js +772 -129
- package/dist/ending-punctuation-conf.js.map +1 -1
- package/dist/ending-punctuation.js +291 -72
- package/dist/ending-punctuation.js.map +1 -1
- package/dist/ending-punctuation.spec.js +2638 -118
- package/dist/ending-punctuation.spec.js.map +1 -1
- package/dist/ending-whitespace.js +58 -0
- package/dist/ending-whitespace.js.map +1 -0
- package/dist/ending-whitespace.spec.js +42 -0
- package/dist/ending-whitespace.spec.js.map +1 -0
- package/dist/field-521-fix.js +96 -0
- package/dist/field-521-fix.js.map +1 -0
- package/dist/field-521-fix.spec.js +51 -0
- package/dist/field-521-fix.spec.js.map +1 -0
- package/dist/field-exclusion.js +214 -63
- package/dist/field-exclusion.js.map +1 -1
- package/dist/field-exclusion.spec.js +1057 -31
- package/dist/field-exclusion.spec.js.map +1 -1
- package/dist/field-structure.js +249 -78
- package/dist/field-structure.js.map +1 -1
- package/dist/field-structure.spec.js +534 -31
- package/dist/field-structure.spec.js.map +1 -1
- package/dist/fields-present.js +31 -27
- package/dist/fields-present.js.map +1 -1
- package/dist/fields-present.spec.js +120 -27
- package/dist/fields-present.spec.js.map +1 -1
- package/dist/fixed-fields.js +72 -27
- package/dist/fixed-fields.js.map +1 -1
- package/dist/fixed-fields.spec.js +139 -27
- package/dist/fixed-fields.spec.js.map +1 -1
- package/dist/identical-fields.js +42 -28
- package/dist/identical-fields.js.map +1 -1
- package/dist/identical-fields.spec.js +98 -27
- package/dist/identical-fields.spec.js.map +1 -1
- package/dist/index.js +202 -27
- package/dist/index.js.map +1 -1
- package/dist/indicator-fixes.js +191 -0
- package/dist/indicator-fixes.js.map +1 -0
- package/dist/indicator-fixes.spec.js +51 -0
- package/dist/indicator-fixes.spec.js.map +1 -0
- package/dist/isbn-issn.js +266 -27
- package/dist/isbn-issn.js.map +1 -1
- package/dist/isbn-issn.spec.js +594 -27
- package/dist/isbn-issn.spec.js.map +1 -1
- package/dist/item-language.js +171 -27
- package/dist/item-language.js.map +1 -1
- package/dist/item-language.spec.js +305 -27
- package/dist/item-language.spec.js.map +1 -1
- package/dist/mergeField500Lisapainokset.js +155 -0
- package/dist/mergeField500Lisapainokset.js.map +1 -0
- package/dist/mergeField500Lisapainokset.spec.js +51 -0
- package/dist/mergeField500Lisapainokset.spec.js.map +1 -0
- package/dist/mergeRelatorTermFields.js +140 -0
- package/dist/mergeRelatorTermFields.js.map +1 -0
- package/dist/mergeRelatorTermFields.spec.js +51 -0
- package/dist/mergeRelatorTermFields.spec.js.map +1 -0
- package/dist/multiple-subfield-0.js +120 -0
- package/dist/multiple-subfield-0.js.map +1 -0
- package/dist/multiple-subfield-0.spec.js +51 -0
- package/dist/multiple-subfield-0.spec.js.map +1 -0
- package/dist/non-breaking-space.js +61 -0
- package/dist/non-breaking-space.js.map +1 -0
- package/dist/non-breaking-space.spec.js +42 -0
- package/dist/non-breaking-space.spec.js.map +1 -0
- package/dist/normalize-identifiers.js +210 -0
- package/dist/normalize-identifiers.js.map +1 -0
- package/dist/normalize-identifiers.spec.js +51 -0
- package/dist/normalize-identifiers.spec.js.map +1 -0
- package/dist/normalize-utf8-diacritics.js +140 -0
- package/dist/normalize-utf8-diacritics.js.map +1 -0
- package/dist/normalize-utf8-diacritics.spec.js +51 -0
- package/dist/normalize-utf8-diacritics.spec.js.map +1 -0
- package/dist/punctuation/index.js +281 -0
- package/dist/punctuation/index.js.map +1 -0
- package/dist/punctuation/rules/aut.js +332 -0
- package/dist/punctuation/rules/aut.js.map +1 -0
- package/dist/punctuation/rules/bib.js +374 -0
- package/dist/punctuation/rules/bib.js.map +1 -0
- package/dist/punctuation/rules/index.js +21 -0
- package/dist/punctuation/rules/index.js.map +1 -0
- package/dist/punctuation.spec.js +51 -0
- package/dist/punctuation.spec.js.map +1 -0
- package/dist/punctuation2.js +726 -0
- package/dist/punctuation2.js.map +1 -0
- package/dist/punctuation2.spec.js +51 -0
- package/dist/punctuation2.spec.js.map +1 -0
- package/dist/reindexSubfield6OccurenceNumbers.js +199 -0
- package/dist/reindexSubfield6OccurenceNumbers.js.map +1 -0
- package/dist/reindexSubfield6OccurenceNumbers.spec.js +51 -0
- package/dist/reindexSubfield6OccurenceNumbers.spec.js.map +1 -0
- package/dist/removeDuplicateDataFields.js +405 -0
- package/dist/removeDuplicateDataFields.js.map +1 -0
- package/dist/removeDuplicateDataFields.spec.js +51 -0
- package/dist/removeDuplicateDataFields.spec.js.map +1 -0
- package/dist/removeInferiorDataFields.js +245 -0
- package/dist/removeInferiorDataFields.js.map +1 -0
- package/dist/removeInferiorDataFields.spec.js +51 -0
- package/dist/removeInferiorDataFields.spec.js.map +1 -0
- package/dist/resolvable-ext-references-melinda.js +112 -31
- package/dist/resolvable-ext-references-melinda.js.map +1 -1
- package/dist/resolvable-ext-references-melinda.spec.js +166 -27
- package/dist/resolvable-ext-references-melinda.spec.js.map +1 -1
- package/dist/resolveOrphanedSubfield6s.js +116 -0
- package/dist/resolveOrphanedSubfield6s.js.map +1 -0
- package/dist/resolveOrphanedSubfield6s.spec.js +51 -0
- package/dist/resolveOrphanedSubfield6s.spec.js.map +1 -0
- package/dist/sanitize-vocabulary-source-codes.js +93 -0
- package/dist/sanitize-vocabulary-source-codes.js.map +1 -0
- package/dist/sanitize-vocabulary-source-codes.spec.js +51 -0
- package/dist/sanitize-vocabulary-source-codes.spec.js.map +1 -0
- package/dist/sort-tags.js +53 -27
- package/dist/sort-tags.js.map +1 -1
- package/dist/sort-tags.spec.js +206 -27
- package/dist/sort-tags.spec.js.map +1 -1
- package/dist/sortRelatorTerms.js +135 -0
- package/dist/sortRelatorTerms.js.map +1 -0
- package/dist/sortRelatorTerms.spec.js +51 -0
- package/dist/sortRelatorTerms.spec.js.map +1 -0
- package/dist/sortSubfields.js +279 -0
- package/dist/sortSubfields.js.map +1 -0
- package/dist/sortSubfields.spec.js +51 -0
- package/dist/sortSubfields.spec.js.map +1 -0
- package/dist/stripPunctuation.js +49 -0
- package/dist/stripPunctuation.js.map +1 -0
- package/dist/stripPunctuation.spec.js +51 -0
- package/dist/stripPunctuation.spec.js.map +1 -0
- package/dist/subfield-exclusion.js +174 -57
- package/dist/subfield-exclusion.js.map +1 -1
- package/dist/subfield-exclusion.spec.js +521 -31
- package/dist/subfield-exclusion.spec.js.map +1 -1
- package/dist/subfield6Utils.js +457 -0
- package/dist/subfield6Utils.js.map +1 -0
- package/dist/subfield8Utils.js +99 -0
- package/dist/subfield8Utils.js.map +1 -0
- package/dist/typeOfDate-008.js +48 -0
- package/dist/typeOfDate-008.js.map +1 -0
- package/dist/typeOfDate-008.spec.js +47 -0
- package/dist/typeOfDate-008.spec.js.map +1 -0
- package/dist/unicode-decomposition.js +139 -30
- package/dist/unicode-decomposition.js.map +1 -1
- package/dist/unicode-decomposition.spec.js +90 -27
- package/dist/unicode-decomposition.spec.js.map +1 -1
- package/dist/update-field-540.js +119 -0
- package/dist/update-field-540.js.map +1 -0
- package/dist/update-field-540.spec.js +51 -0
- package/dist/update-field-540.spec.js.map +1 -0
- package/dist/urn.js +185 -0
- package/dist/urn.js.map +1 -0
- package/dist/urn.spec.js +238 -0
- package/dist/urn.spec.js.map +1 -0
- package/dist/utils.js +58 -0
- package/dist/utils.js.map +1 -0
- package/package.json +114 -124
- package/src/access-rights.js +84 -0
- package/src/access-rights.spec.js +126 -0
- package/src/double-commas.js +12 -49
- package/src/double-commas.spec.js +50 -82
- package/src/duplicates-ind1.js +34 -74
- package/src/duplicates-ind1.spec.js +39 -117
- package/src/empty-fields.js +62 -74
- package/src/empty-fields.spec.js +134 -207
- package/src/ending-punctuation-conf.js +679 -644
- package/src/ending-punctuation.js +260 -250
- package/src/ending-punctuation.spec.js +2545 -2322
- package/src/ending-whitespace.js +40 -0
- package/src/ending-whitespace.spec.js +44 -0
- package/src/field-521-fix.js +92 -0
- package/src/field-521-fix.spec.js +52 -0
- package/src/field-exclusion.js +197 -215
- package/src/field-exclusion.spec.js +883 -481
- package/src/field-structure.js +213 -271
- package/src/field-structure.spec.js +597 -474
- package/src/fields-present.js +19 -49
- package/src/fields-present.spec.js +90 -91
- package/src/fixed-fields.js +61 -94
- package/src/fixed-fields.spec.js +81 -125
- package/src/identical-fields.js +29 -48
- package/src/identical-fields.spec.js +114 -146
- package/src/index.js +41 -46
- package/src/indicator-fixes.js +211 -0
- package/src/indicator-fixes.spec.js +52 -0
- package/src/isbn-issn.js +254 -106
- package/src/isbn-issn.spec.js +399 -172
- package/src/item-language.js +158 -195
- package/src/item-language.spec.js +314 -306
- package/src/mergeField500Lisapainokset.js +153 -0
- package/src/mergeField500Lisapainokset.spec.js +52 -0
- package/src/mergeRelatorTermFields.js +143 -0
- package/src/mergeRelatorTermFields.spec.js +52 -0
- package/src/multiple-subfield-0.js +129 -0
- package/src/multiple-subfield-0.spec.js +52 -0
- package/src/non-breaking-space.js +49 -0
- package/src/non-breaking-space.spec.js +44 -0
- package/src/normalize-identifiers.js +197 -0
- package/src/normalize-identifiers.spec.js +52 -0
- package/src/normalize-utf8-diacritics.js +141 -0
- package/src/normalize-utf8-diacritics.spec.js +52 -0
- package/src/punctuation/index.js +292 -0
- package/src/punctuation/rules/aut.js +372 -0
- package/src/punctuation/rules/bib.js +420 -0
- package/src/punctuation/rules/index.js +7 -0
- package/src/punctuation.spec.js +52 -0
- package/src/punctuation2.js +441 -0
- package/src/punctuation2.spec.js +52 -0
- package/src/reindexSubfield6OccurenceNumbers.js +210 -0
- package/src/reindexSubfield6OccurenceNumbers.spec.js +52 -0
- package/src/removeDuplicateDataFields.js +447 -0
- package/src/removeDuplicateDataFields.spec.js +52 -0
- package/src/removeInferiorDataFields.js +259 -0
- package/src/removeInferiorDataFields.spec.js +52 -0
- package/src/resolvable-ext-references-melinda.js +89 -122
- package/src/resolvable-ext-references-melinda.spec.js +168 -198
- package/src/resolveOrphanedSubfield6s.js +115 -0
- package/src/resolveOrphanedSubfield6s.spec.js +52 -0
- package/src/sanitize-vocabulary-source-codes.js +99 -0
- package/src/sanitize-vocabulary-source-codes.spec.js +52 -0
- package/src/sort-tags.js +34 -60
- package/src/sort-tags.spec.js +256 -290
- package/src/sortRelatorTerms.js +142 -0
- package/src/sortRelatorTerms.spec.js +52 -0
- package/src/sortSubfields.js +176 -0
- package/src/sortSubfields.spec.js +52 -0
- package/src/stripPunctuation.js +42 -0
- package/src/stripPunctuation.spec.js +52 -0
- package/src/subfield-exclusion.js +157 -180
- package/src/subfield-exclusion.spec.js +507 -453
- package/src/subfield6Utils.js +485 -0
- package/src/subfield8Utils.js +102 -0
- package/src/typeOfDate-008.js +40 -0
- package/src/typeOfDate-008.spec.js +47 -0
- package/src/unicode-decomposition.js +130 -145
- package/src/unicode-decomposition.spec.js +89 -115
- package/src/update-field-540.js +99 -0
- package/src/update-field-540.spec.js +52 -0
- package/src/urn.js +164 -0
- package/src/urn.spec.js +231 -0
- package/src/utils.js +52 -0
- package/test-fixtures/duplicates-ind1/01/expectedResult.json +4 -0
- package/test-fixtures/duplicates-ind1/01/metadata.json +4 -0
- package/test-fixtures/duplicates-ind1/01/record.json +16 -0
- package/test-fixtures/duplicates-ind1/02/expectedResult.json +6 -0
- package/test-fixtures/duplicates-ind1/02/metadata.json +4 -0
- package/test-fixtures/duplicates-ind1/02/record.json +16 -0
- package/test-fixtures/duplicates-ind1/03/expectedResult.json +13 -0
- package/test-fixtures/duplicates-ind1/03/metadata.json +6 -0
- package/test-fixtures/duplicates-ind1/03/record.json +16 -0
- package/test-fixtures/ending-whitespace/01/expectedResult.json +4 -0
- package/test-fixtures/ending-whitespace/01/metadata.json +6 -0
- package/test-fixtures/ending-whitespace/01/record.json +15 -0
- package/test-fixtures/ending-whitespace/02/expectedResult.json +4 -0
- package/test-fixtures/ending-whitespace/02/metadata.json +6 -0
- package/test-fixtures/ending-whitespace/02/record.json +15 -0
- package/test-fixtures/ending-whitespace/03/expectedResult.json +17 -0
- package/test-fixtures/ending-whitespace/03/metadata.json +6 -0
- package/test-fixtures/ending-whitespace/03/record.json +15 -0
- package/test-fixtures/ending-whitespace/04/expectedResult.json +10 -0
- package/test-fixtures/ending-whitespace/04/metadata.json +6 -0
- package/test-fixtures/ending-whitespace/04/record.json +8 -0
- package/test-fixtures/fix521/01/expectedResult.json +6 -0
- package/test-fixtures/fix521/01/metadata.json +5 -0
- package/test-fixtures/fix521/01/record.json +13 -0
- package/test-fixtures/fix521/02/expectedResult.json +15 -0
- package/test-fixtures/fix521/02/metadata.json +5 -0
- package/test-fixtures/fix521/02/record.json +13 -0
- package/test-fixtures/fix521/03/expectedResult.json +5 -0
- package/test-fixtures/fix521/03/metadata.json +5 -0
- package/test-fixtures/fix521/03/record.json +13 -0
- package/test-fixtures/indicator-fixes/01/expectedResult.json +9 -0
- package/test-fixtures/indicator-fixes/01/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/01/record.json +64 -0
- package/test-fixtures/indicator-fixes/02/expectedResult.json +66 -0
- package/test-fixtures/indicator-fixes/02/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/02/record.json +64 -0
- package/test-fixtures/indicator-fixes/03/expectedResult.json +55 -0
- package/test-fixtures/indicator-fixes/03/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/03/record.json +54 -0
- package/test-fixtures/indicator-fixes/04/expectedResult.json +66 -0
- package/test-fixtures/indicator-fixes/04/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/04/record.json +65 -0
- package/test-fixtures/indicator-fixes/05/expectedResult.json +66 -0
- package/test-fixtures/indicator-fixes/05/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/05/record.json +65 -0
- package/test-fixtures/indicator-fixes/06/expectedResult.json +75 -0
- package/test-fixtures/indicator-fixes/06/metadata.json +5 -0
- package/test-fixtures/indicator-fixes/06/record.json +74 -0
- package/test-fixtures/lisapainokset/fixer/01/expectedResult.json +37 -0
- package/test-fixtures/lisapainokset/fixer/01/metadata.json +6 -0
- package/test-fixtures/lisapainokset/fixer/01/record.json +61 -0
- package/test-fixtures/lisapainokset/fixer/02/expectedResult.json +44 -0
- package/test-fixtures/lisapainokset/fixer/02/metadata.json +6 -0
- package/test-fixtures/lisapainokset/fixer/02/record.json +45 -0
- package/test-fixtures/lisapainokset/fixer/03/expectedResult.json +21 -0
- package/test-fixtures/lisapainokset/fixer/03/metadata.json +6 -0
- package/test-fixtures/lisapainokset/fixer/03/record.json +45 -0
- package/test-fixtures/lisapainokset/validator/01/expectedResult.json +7 -0
- package/test-fixtures/lisapainokset/validator/01/metadata.json +6 -0
- package/test-fixtures/lisapainokset/validator/01/record.json +45 -0
- package/test-fixtures/lisapainokset/validator/02/expectedResult.json +6 -0
- package/test-fixtures/lisapainokset/validator/02/metadata.json +6 -0
- package/test-fixtures/lisapainokset/validator/02/record.json +61 -0
- package/test-fixtures/lisapainokset/validator/03/expectedResult.json +4 -0
- package/test-fixtures/lisapainokset/validator/03/metadata.json +6 -0
- package/test-fixtures/lisapainokset/validator/03/record.json +37 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/01/expectedResult.json +14 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/01/metadata.json +6 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/01/record.json +16 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/02/expectedResult.json +17 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/02/metadata.json +6 -0
- package/test-fixtures/mergeRelatorTermFields/fixer/02/record.json +23 -0
- package/test-fixtures/mergeRelatorTermFields/validator/01/expectedResult.json +6 -0
- package/test-fixtures/mergeRelatorTermFields/validator/01/metadata.json +6 -0
- package/test-fixtures/mergeRelatorTermFields/validator/01/record.json +16 -0
- package/test-fixtures/mergeRelatorTermFields/validator/02/expectedResult.json +4 -0
- package/test-fixtures/mergeRelatorTermFields/validator/02/metadata.json +6 -0
- package/test-fixtures/mergeRelatorTermFields/validator/02/record.json +16 -0
- package/test-fixtures/non-breaking-space/01/expectedResult.json +4 -0
- package/test-fixtures/non-breaking-space/01/metadata.json +6 -0
- package/test-fixtures/non-breaking-space/01/record.json +15 -0
- package/test-fixtures/non-breaking-space/02/expectedResult.json +4 -0
- package/test-fixtures/non-breaking-space/02/metadata.json +6 -0
- package/test-fixtures/non-breaking-space/02/record.json +15 -0
- package/test-fixtures/non-breaking-space/03/expectedResult.json +17 -0
- package/test-fixtures/non-breaking-space/03/metadata.json +6 -0
- package/test-fixtures/non-breaking-space/03/record.json +15 -0
- package/test-fixtures/non-breaking-space/04/expectedResult.json +21 -0
- package/test-fixtures/non-breaking-space/04/metadata.json +6 -0
- package/test-fixtures/non-breaking-space/04/record.json +19 -0
- package/test-fixtures/normalize-identifiers/01/expectedResult.json +8 -0
- package/test-fixtures/normalize-identifiers/01/metadata.json +5 -0
- package/test-fixtures/normalize-identifiers/01/record.json +81 -0
- package/test-fixtures/normalize-identifiers/02/expectedResult.json +92 -0
- package/test-fixtures/normalize-identifiers/02/metadata.json +5 -0
- package/test-fixtures/normalize-identifiers/02/record.json +92 -0
- package/test-fixtures/normalize-identifiers/03/expectedResult.json +63 -0
- package/test-fixtures/normalize-identifiers/03/metadata.json +5 -0
- package/test-fixtures/normalize-identifiers/03/record.json +61 -0
- package/test-fixtures/normalize-identifiers/04/expectedResult.json +79 -0
- package/test-fixtures/normalize-identifiers/04/metadata.json +5 -0
- package/test-fixtures/normalize-identifiers/04/record.json +77 -0
- package/test-fixtures/normalize-utf8-diacritics/01/expectedResult.json +7 -0
- package/test-fixtures/normalize-utf8-diacritics/01/metadata.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/01/record.json +39 -0
- package/test-fixtures/normalize-utf8-diacritics/02/expectedResult.json +41 -0
- package/test-fixtures/normalize-utf8-diacritics/02/metadata.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/02/record.json +39 -0
- package/test-fixtures/normalize-utf8-diacritics/03/expectedResult.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/03/metadata.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/03/record.json +37 -0
- package/test-fixtures/normalize-utf8-diacritics/04/expectedResult.json +41 -0
- package/test-fixtures/normalize-utf8-diacritics/04/metadata.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/04/record.json +39 -0
- package/test-fixtures/normalize-utf8-diacritics/05/expectedResult.json +41 -0
- package/test-fixtures/normalize-utf8-diacritics/05/metadata.json +5 -0
- package/test-fixtures/normalize-utf8-diacritics/05/record.json +41 -0
- package/test-fixtures/punctuation/01/expectedResult.json +3 -0
- package/test-fixtures/punctuation/01/metadata.json +4 -0
- package/test-fixtures/punctuation/01/record.json +18 -0
- package/test-fixtures/punctuation/02/expectedResult.json +3 -0
- package/test-fixtures/punctuation/02/metadata.json +4 -0
- package/test-fixtures/punctuation/02/record.json +18 -0
- package/test-fixtures/punctuation/03/expectedResult.json +21 -0
- package/test-fixtures/punctuation/03/metadata.json +5 -0
- package/test-fixtures/punctuation/03/record.json +19 -0
- package/test-fixtures/punctuation/04/expectedResult.json +21 -0
- package/test-fixtures/punctuation/04/metadata.json +5 -0
- package/test-fixtures/punctuation/04/record.json +19 -0
- package/test-fixtures/punctuation/05/expectedResult.json +44 -0
- package/test-fixtures/punctuation/05/metadata.json +5 -0
- package/test-fixtures/punctuation/05/record.json +42 -0
- package/test-fixtures/punctuation2/01/expectedResult.json +12 -0
- package/test-fixtures/punctuation2/01/metadata.json +6 -0
- package/test-fixtures/punctuation2/01/record.json +37 -0
- package/test-fixtures/punctuation2/02/expectedResult.json +4 -0
- package/test-fixtures/punctuation2/02/metadata.json +6 -0
- package/test-fixtures/punctuation2/02/record.json +14 -0
- package/test-fixtures/punctuation2/04/expectedResult.json +7 -0
- package/test-fixtures/punctuation2/04/metadata.json +6 -0
- package/test-fixtures/punctuation2/04/record.json +22 -0
- package/test-fixtures/punctuation2/05/expectedResult.json +6 -0
- package/test-fixtures/punctuation2/05/metadata.json +6 -0
- package/test-fixtures/punctuation2/05/record.json +12 -0
- package/test-fixtures/punctuation2/98/expectedResult.json +45 -0
- package/test-fixtures/punctuation2/98/metadata.json +6 -0
- package/test-fixtures/punctuation2/98/record.json +43 -0
- package/test-fixtures/punctuation2/99/expectedResult.json +15 -0
- package/test-fixtures/punctuation2/99/metadata.json +6 -0
- package/test-fixtures/punctuation2/99/record.json +14 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f01/expectedResult.json +35 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f01/metadata.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f01/record.json +34 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f02/expectedResult.json +53 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f02/metadata.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f02/record.json +51 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f03/expectedResult.json +46 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f03/metadata.json +7 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/f03/record.json +44 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v01/expectedResult.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v01/metadata.json +5 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v01/record.json +31 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v02/expectedResult.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v02/metadata.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v02/record.json +38 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v03/expectedResult.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v03/metadata.json +6 -0
- package/test-fixtures/reindex-sf6-occurence-numbers/v03/record.json +30 -0
- package/test-fixtures/remove-duplicate-datafields/f01/expectedResult.json +35 -0
- package/test-fixtures/remove-duplicate-datafields/f01/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f01/record.json +34 -0
- package/test-fixtures/remove-duplicate-datafields/f03/expectedResult.json +20 -0
- package/test-fixtures/remove-duplicate-datafields/f03/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f03/record.json +33 -0
- package/test-fixtures/remove-duplicate-datafields/f03b/expectedResult.json +20 -0
- package/test-fixtures/remove-duplicate-datafields/f03b/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f03b/record.json +35 -0
- package/test-fixtures/remove-duplicate-datafields/f03c/expectedResult.json +25 -0
- package/test-fixtures/remove-duplicate-datafields/f03c/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f03c/record.json +43 -0
- package/test-fixtures/remove-duplicate-datafields/f04/expectedResult.json +31 -0
- package/test-fixtures/remove-duplicate-datafields/f04/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f04/record.json +41 -0
- package/test-fixtures/remove-duplicate-datafields/f05/expectedResult.json +23 -0
- package/test-fixtures/remove-duplicate-datafields/f05/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f05/record.json +29 -0
- package/test-fixtures/remove-duplicate-datafields/f06/expectedResult.json +24 -0
- package/test-fixtures/remove-duplicate-datafields/f06/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f06/record.json +41 -0
- package/test-fixtures/remove-duplicate-datafields/f07/expectedResult.json +15 -0
- package/test-fixtures/remove-duplicate-datafields/f07/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f07/record.json +21 -0
- package/test-fixtures/remove-duplicate-datafields/f08/expectedResult.json +21 -0
- package/test-fixtures/remove-duplicate-datafields/f08/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f08/record.json +33 -0
- package/test-fixtures/remove-duplicate-datafields/f09/expectedResult.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f09/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f09/record.json +9 -0
- package/test-fixtures/remove-duplicate-datafields/f10/expectedResult.json +15 -0
- package/test-fixtures/remove-duplicate-datafields/f10/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f10/record.json +24 -0
- package/test-fixtures/remove-duplicate-datafields/f11/expectedResult.json +30 -0
- package/test-fixtures/remove-duplicate-datafields/f11/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/f11/record.json +53 -0
- package/test-fixtures/remove-duplicate-datafields/v01/expectedResult.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/v01/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/v01/record.json +31 -0
- package/test-fixtures/remove-duplicate-datafields/v02/expectedResult.json +10 -0
- package/test-fixtures/remove-duplicate-datafields/v02/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/v02/record.json +45 -0
- package/test-fixtures/remove-duplicate-datafields/v03/expectedResult.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/v03/metadata.json +7 -0
- package/test-fixtures/remove-duplicate-datafields/v03/record.json +37 -0
- package/test-fixtures/remove-duplicate-datafields/v04/expectedResult.json +8 -0
- package/test-fixtures/remove-duplicate-datafields/v04/metadata.json +6 -0
- package/test-fixtures/remove-duplicate-datafields/v04/record.json +41 -0
- package/test-fixtures/remove-inferior-datafields/f01/expectedResult.json +21 -0
- package/test-fixtures/remove-inferior-datafields/f01/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/f01/record.json +31 -0
- package/test-fixtures/remove-inferior-datafields/f03/expectedResult.json +16 -0
- package/test-fixtures/remove-inferior-datafields/f03/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/f03/record.json +27 -0
- package/test-fixtures/remove-inferior-datafields/f04/expectedResult.json +31 -0
- package/test-fixtures/remove-inferior-datafields/f04/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/f04/record.json +38 -0
- package/test-fixtures/remove-inferior-datafields/f05/expectedResult.json +34 -0
- package/test-fixtures/remove-inferior-datafields/f05/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/f05/record.json +41 -0
- package/test-fixtures/remove-inferior-datafields/f06/expectedResult.json +16 -0
- package/test-fixtures/remove-inferior-datafields/f06/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/f06/record.json +20 -0
- package/test-fixtures/remove-inferior-datafields/v01/expectedResult.json +6 -0
- package/test-fixtures/remove-inferior-datafields/v01/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/v01/record.json +31 -0
- package/test-fixtures/remove-inferior-datafields/v02/expectedResult.json +6 -0
- package/test-fixtures/remove-inferior-datafields/v02/metadata.json +6 -0
- package/test-fixtures/remove-inferior-datafields/v02/record.json +21 -0
- package/test-fixtures/remove-orphanded-sf6s/f01/expectedResult.json +35 -0
- package/test-fixtures/remove-orphanded-sf6s/f01/metadata.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/f01/record.json +34 -0
- package/test-fixtures/remove-orphanded-sf6s/f02/expectedResult.json +40 -0
- package/test-fixtures/remove-orphanded-sf6s/f02/metadata.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/f02/record.json +43 -0
- package/test-fixtures/remove-orphanded-sf6s/v01/expectedResult.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/v01/metadata.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/v01/record.json +31 -0
- package/test-fixtures/remove-orphanded-sf6s/v02/expectedResult.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/v02/metadata.json +6 -0
- package/test-fixtures/remove-orphanded-sf6s/v02/record.json +31 -0
- package/test-fixtures/resolvable-ext-references-melinda.js +0 -27
- package/test-fixtures/sanitize-vocabulary-source-codes/f01/expectedResult.json +32 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/f01/metadata.json +6 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/f01/record.json +32 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/f02/expectedResult.json +24 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/f02/metadata.json +6 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/f02/record.json +24 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/v01/expectedResult.json +12 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/v01/metadata.json +6 -0
- package/test-fixtures/sanitize-vocabulary-source-codes/v01/record.json +24 -0
- package/test-fixtures/sort-relator-terms/f01/expectedResult.json +23 -0
- package/test-fixtures/sort-relator-terms/f01/metadata.json +6 -0
- package/test-fixtures/sort-relator-terms/f01/record.json +22 -0
- package/test-fixtures/sort-relator-terms/f02/expectedResult.json +26 -0
- package/test-fixtures/sort-relator-terms/f02/metadata.json +6 -0
- package/test-fixtures/sort-relator-terms/f02/record.json +22 -0
- package/test-fixtures/sort-relator-terms/v01/expectedResult.json +5 -0
- package/test-fixtures/sort-relator-terms/v01/metadata.json +6 -0
- package/test-fixtures/sort-relator-terms/v01/record.json +22 -0
- package/test-fixtures/sort-relator-terms/v02/expectedResult.json +6 -0
- package/test-fixtures/sort-relator-terms/v02/metadata.json +6 -0
- package/test-fixtures/sort-relator-terms/v02/record.json +14 -0
- package/test-fixtures/sort-subfields/f01/expectedResult.json +24 -0
- package/test-fixtures/sort-subfields/f01/metadata.json +6 -0
- package/test-fixtures/sort-subfields/f01/record.json +20 -0
- package/test-fixtures/sort-subfields/v01/expectedResult.json +5 -0
- package/test-fixtures/sort-subfields/v01/metadata.json +6 -0
- package/test-fixtures/sort-subfields/v01/record.json +24 -0
- package/test-fixtures/sort-subfields/v02/expectedResult.json +6 -0
- package/test-fixtures/sort-subfields/v02/metadata.json +6 -0
- package/test-fixtures/sort-subfields/v02/record.json +8 -0
- package/test-fixtures/strip-punctuation/01/expectedResult.json +12 -0
- package/test-fixtures/strip-punctuation/01/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/01/record.json +37 -0
- package/test-fixtures/strip-punctuation/02/expectedResult.json +4 -0
- package/test-fixtures/strip-punctuation/02/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/02/record.json +14 -0
- package/test-fixtures/strip-punctuation/04/expectedResult.json +6 -0
- package/test-fixtures/strip-punctuation/04/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/04/record.json +22 -0
- package/test-fixtures/strip-punctuation/05/expectedResult.json +6 -0
- package/test-fixtures/strip-punctuation/05/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/05/record.json +12 -0
- package/test-fixtures/strip-punctuation/98/expectedResult.json +44 -0
- package/test-fixtures/strip-punctuation/98/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/98/record.json +45 -0
- package/test-fixtures/strip-punctuation/99/expectedResult.json +16 -0
- package/test-fixtures/strip-punctuation/99/metadata.json +6 -0
- package/test-fixtures/strip-punctuation/99/record.json +16 -0
- package/test-fixtures/subfield0/f01/expectedResult.json +25 -0
- package/test-fixtures/subfield0/f01/metadata.json +6 -0
- package/test-fixtures/subfield0/f01/record.json +23 -0
- package/test-fixtures/subfield0/f02/expectedResult.json +35 -0
- package/test-fixtures/subfield0/f02/metadata.json +6 -0
- package/test-fixtures/subfield0/f02/record.json +41 -0
- package/test-fixtures/subfield0/f03/expectedResult.json +21 -0
- package/test-fixtures/subfield0/f03/metadata.json +7 -0
- package/test-fixtures/subfield0/f03/record.json +24 -0
- package/test-fixtures/subfield0/v01/expectedResult.json +4 -0
- package/test-fixtures/subfield0/v01/metadata.json +6 -0
- package/test-fixtures/subfield0/v01/record.json +23 -0
- package/test-fixtures/subfield0/v02/expectedResult.json +9 -0
- package/test-fixtures/subfield0/v02/metadata.json +6 -0
- package/test-fixtures/subfield0/v02/record.json +38 -0
- package/test-fixtures/typeOfDate-008/01/expectedResult.json +3 -0
- package/test-fixtures/typeOfDate-008/01/metadata.json +4 -0
- package/test-fixtures/typeOfDate-008/01/record.json +14 -0
- package/test-fixtures/typeOfDate-008/02/expectedResult.json +4 -0
- package/test-fixtures/typeOfDate-008/02/metadata.json +4 -0
- package/test-fixtures/typeOfDate-008/02/record.json +14 -0
- package/test-fixtures/typeOfDate-008/03/expectedResult.json +14 -0
- package/test-fixtures/typeOfDate-008/03/metadata.json +5 -0
- package/test-fixtures/typeOfDate-008/03/record.json +14 -0
- package/test-fixtures/typeOfDate-008/04/expectedResult.json +14 -0
- package/test-fixtures/typeOfDate-008/04/metadata.json +5 -0
- package/test-fixtures/typeOfDate-008/04/record.json +14 -0
- package/test-fixtures/typeOfDate-008/05/expectedResult.json +14 -0
- package/test-fixtures/typeOfDate-008/05/metadata.json +5 -0
- package/test-fixtures/typeOfDate-008/05/record.json +14 -0
- package/test-fixtures/update-field-540/f01/expectedResult.json +23 -0
- package/test-fixtures/update-field-540/f01/metadata.json +6 -0
- package/test-fixtures/update-field-540/f01/record.json +23 -0
- package/test-fixtures/update-field-540/v01/expectedResult.json +7 -0
- package/test-fixtures/update-field-540/v01/metadata.json +6 -0
- package/test-fixtures/update-field-540/v01/record.json +23 -0
- package/.travis.yml +0 -10
|
@@ -1,28 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _chai = require("chai");
|
|
4
|
+
var _marcRecord = require("@natlibfi/marc-record");
|
|
5
|
+
var _duplicatesInd = _interopRequireDefault(require("./duplicates-ind1"));
|
|
6
|
+
var _fixura = require("@natlibfi/fixura");
|
|
7
|
+
var _fixugen = _interopRequireDefault(require("@natlibfi/fixugen"));
|
|
8
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
(0, _fixugen.default)({
|
|
11
|
+
callback,
|
|
12
|
+
path: [__dirname, '..', 'test-fixtures', 'duplicates-ind1'],
|
|
13
|
+
useMetadataFile: true,
|
|
14
|
+
recurse: false,
|
|
15
|
+
fixura: {
|
|
16
|
+
reader: _fixura.READERS.JSON
|
|
17
|
+
},
|
|
18
|
+
mocha: {
|
|
19
|
+
before: () => testValidatorFactory()
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const debug = (0, _debug.default)('@natlibfi/marc-record-validators-melinda/duplicates-ind1:test');
|
|
23
|
+
async function testValidatorFactory() {
|
|
24
|
+
const validator = await (0, _duplicatesInd.default)(/^500$/u);
|
|
25
|
+
(0, _chai.expect)(validator).to.be.an('object').that.has.any.keys('description', 'validate');
|
|
26
|
+
(0, _chai.expect)(validator.description).to.be.a('string');
|
|
27
|
+
(0, _chai.expect)(validator.validate).to.be.a('function');
|
|
28
|
+
}
|
|
29
|
+
async function callback({
|
|
30
|
+
getFixture,
|
|
31
|
+
tagPattern,
|
|
32
|
+
fix = false
|
|
33
|
+
}) {
|
|
34
|
+
const validator = await (0, _duplicatesInd.default)(new RegExp(tagPattern, 'u'));
|
|
35
|
+
const record = new _marcRecord.MarcRecord(getFixture('record.json'));
|
|
36
|
+
const expectedResult = getFixture('expectedResult.json');
|
|
37
|
+
if (!fix) {
|
|
38
|
+
const result = await validator.validate(record);
|
|
39
|
+
return (0, _chai.expect)(result).to.eql(expectedResult);
|
|
40
|
+
}
|
|
41
|
+
const fixedRecord = await validator.fix(record);
|
|
42
|
+
debug(fixedRecord);
|
|
43
|
+
(0, _chai.expect)(record.fields).to.eql(expectedResult);
|
|
44
|
+
}
|
|
28
45
|
//# sourceMappingURL=duplicates-ind1.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"duplicates-ind1.spec.js","names":["_chai","require","_marcRecord","_duplicatesInd","_interopRequireDefault","_fixura","_fixugen","_debug","obj","__esModule","default","generateTests","callback","path","__dirname","useMetadataFile","recurse","fixura","reader","READERS","JSON","mocha","before","testValidatorFactory","debug","createDebugLogger","validator","validatorFactory","expect","to","be","an","that","has","any","keys","description","a","validate","getFixture","tagPattern","fix","RegExp","record","MarcRecord","expectedResult","result","eql","fixedRecord","fields"],"sources":["../src/duplicates-ind1.spec.js"],"sourcesContent":["import {expect} from 'chai';\nimport {MarcRecord} from '@natlibfi/marc-record';\nimport validatorFactory from './duplicates-ind1';\n\nimport {READERS} from '@natlibfi/fixura';\nimport generateTests from '@natlibfi/fixugen';\nimport createDebugLogger from 'debug';\n\ngenerateTests({\n callback,\n path: [__dirname, '..', 'test-fixtures', 'duplicates-ind1'],\n useMetadataFile: true,\n recurse: false,\n fixura: {\n reader: READERS.JSON\n },\n mocha: {\n before: () => testValidatorFactory()\n }\n});\n\nconst debug = createDebugLogger('@natlibfi/marc-record-validators-melinda/duplicates-ind1:test');\n\nasync function testValidatorFactory() {\n const validator = await validatorFactory(/^500$/u);\n\n expect(validator)\n .to.be.an('object')\n .that.has.any.keys('description', 'validate');\n\n expect(validator.description).to.be.a('string');\n expect(validator.validate).to.be.a('function');\n}\n\nasync function callback({getFixture, tagPattern, fix = false}) {\n const validator = await validatorFactory(new RegExp(tagPattern, 'u'));\n const record = new MarcRecord(getFixture('record.json'));\n const expectedResult = getFixture('expectedResult.json');\n\n if (!fix) {\n const result = await validator.validate(record);\n return expect(result).to.eql(expectedResult);\n }\n\n const fixedRecord = await validator.fix(record);\n debug(fixedRecord);\n expect(record.fields).to.eql(expectedResult);\n}\n"],"mappings":";;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,MAAA,GAAAH,sBAAA,CAAAH,OAAA;AAAsC,SAAAG,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEtC,IAAAG,gBAAa,EAAC;EACZC,QAAQ;EACRC,IAAI,EAAE,CAACC,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,iBAAiB,CAAC;EAC3DC,eAAe,EAAE,IAAI;EACrBC,OAAO,EAAE,KAAK;EACdC,MAAM,EAAE;IACNC,MAAM,EAAEC,eAAO,CAACC;EAClB,CAAC;EACDC,KAAK,EAAE;IACLC,MAAM,EAAEA,CAAA,KAAMC,oBAAoB,CAAC;EACrC;AACF,CAAC,CAAC;AAEF,MAAMC,KAAK,GAAG,IAAAC,cAAiB,EAAC,+DAA+D,CAAC;AAEhG,eAAeF,oBAAoBA,CAAA,EAAG;EACpC,MAAMG,SAAS,GAAG,MAAM,IAAAC,sBAAgB,EAAC,QAAQ,CAAC;EAElD,IAAAC,YAAM,EAACF,SAAS,CAAC,CACdG,EAAE,CAACC,EAAE,CAACC,EAAE,CAAC,QAAQ,CAAC,CAClBC,IAAI,CAACC,GAAG,CAACC,GAAG,CAACC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC;EAE/C,IAAAP,YAAM,EAACF,SAAS,CAACU,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-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
const ERRORS = {
|
|
8
|
+
EMPTY_SUBFIELDS: 2,
|
|
9
|
+
MISSING_SUBFIELD_VALUES: 3
|
|
10
|
+
};
|
|
11
|
+
function _default() {
|
|
12
|
+
return {
|
|
13
|
+
description: 'Handles empty fields',
|
|
14
|
+
validate,
|
|
15
|
+
fix
|
|
16
|
+
};
|
|
17
|
+
function validate(record) {
|
|
18
|
+
const errors = findErrors(record.fields);
|
|
19
|
+
if (errors.length > 0) {
|
|
20
|
+
return {
|
|
21
|
+
valid: false,
|
|
22
|
+
messages: errors.map(error => {
|
|
23
|
+
// eslint-disable-line array-callback-return
|
|
24
|
+
switch (error.code) {
|
|
25
|
+
case ERRORS.EMPTY_SUBFIELDS:
|
|
26
|
+
return `Field ${error.field.tag} has no subfields`;
|
|
27
|
+
case ERRORS.MISSING_SUBFIELD_VALUES:
|
|
28
|
+
return `Field ${error.field.tag} has missing subfield values: ${error.emptySubfields.map(sf => sf.code).join()}`;
|
|
29
|
+
default:
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
valid: true
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function fix(record) {
|
|
39
|
+
const errors = findErrors(record.fields);
|
|
40
|
+
errors.forEach(error => {
|
|
41
|
+
if (error.code === ERRORS.MISSING_SUBFIELD_VALUES) {
|
|
42
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
43
|
+
if (error.emptySubfields.length === error.field.subfields.length) {
|
|
44
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
45
|
+
record.removeField(error.field);
|
|
46
|
+
} else {
|
|
47
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
48
|
+
error.emptySubfields.forEach(sf => {
|
|
49
|
+
record.removeSubfield(sf, error.field);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
// eslint-disable-line functional/no-conditional-statements
|
|
54
|
+
record.removeField(error.field);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function findErrors(fields) {
|
|
59
|
+
return fields.reduce((errors, field) => {
|
|
60
|
+
if (field.subfields) {
|
|
61
|
+
if (field.subfields.length === 0) {
|
|
62
|
+
return errors.concat({
|
|
63
|
+
field,
|
|
64
|
+
code: ERRORS.EMPTY_SUBFIELDS
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const subfieldsWithoutValue = field.subfields.filter(sf => !sf.value);
|
|
68
|
+
if (subfieldsWithoutValue.length > 0) {
|
|
69
|
+
return errors.concat({
|
|
70
|
+
field,
|
|
71
|
+
emptySubfields: subfieldsWithoutValue,
|
|
72
|
+
code: ERRORS.MISSING_SUBFIELD_VALUES
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return errors;
|
|
77
|
+
}, []);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
30
80
|
//# sourceMappingURL=empty-fields.js.map
|
package/dist/empty-fields.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"empty-fields.js","names":["ERRORS","EMPTY_SUBFIELDS","MISSING_SUBFIELD_VALUES","_default","description","validate","fix","record","errors","findErrors","fields","length","valid","messages","map","error","code","field","tag","emptySubfields","sf","join","forEach","subfields","removeField","removeSubfield","reduce","concat","subfieldsWithoutValue","filter","value"],"sources":["../src/empty-fields.js"],"sourcesContent":["const ERRORS = {\n EMPTY_SUBFIELDS: 2,\n MISSING_SUBFIELD_VALUES: 3\n};\n\nexport default function () {\n return {\n description: 'Handles empty fields',\n validate,\n fix\n };\n\n function validate(record) {\n const errors = findErrors(record.fields);\n if (errors.length > 0) {\n return {\n valid: false,\n messages: errors.map(error => { // eslint-disable-line array-callback-return\n switch (error.code) {\n case ERRORS.EMPTY_SUBFIELDS:\n return `Field ${error.field.tag} has no subfields`;\n case ERRORS.MISSING_SUBFIELD_VALUES:\n return `Field ${error.field.tag} has missing subfield values: ${error.emptySubfields.map(sf => sf.code).join()}`;\n default:\n }\n })\n };\n }\n\n return {valid: true};\n }\n\n function fix(record) {\n const errors = findErrors(record.fields);\n errors.forEach(error => {\n if (error.code === ERRORS.MISSING_SUBFIELD_VALUES) { // eslint-disable-line functional/no-conditional-statements\n if (error.emptySubfields.length === error.field.subfields.length) { // eslint-disable-line functional/no-conditional-statements\n record.removeField(error.field);\n } else { // eslint-disable-line functional/no-conditional-statements\n error.emptySubfields.forEach(sf => {\n record.removeSubfield(sf, error.field);\n });\n }\n } else { // eslint-disable-line functional/no-conditional-statements\n record.removeField(error.field);\n }\n });\n }\n\n function findErrors(fields) {\n return fields.reduce((errors, field) => {\n if (field.subfields) {\n if (field.subfields.length === 0) {\n return errors.concat({field, code: ERRORS.EMPTY_SUBFIELDS});\n }\n\n const subfieldsWithoutValue = field.subfields.filter(sf => !sf.value);\n\n if (subfieldsWithoutValue.length > 0) {\n return errors.concat({\n field,\n emptySubfields: subfieldsWithoutValue,\n code: ERRORS.MISSING_SUBFIELD_VALUES\n });\n }\n }\n\n return errors;\n }, []);\n }\n}\n"],"mappings":";;;;;;AAAA,MAAMA,MAAM,GAAG;EACbC,eAAe,EAAE,CAAC;EAClBC,uBAAuB,EAAE;AAC3B,CAAC;AAEc,SAAAC,SAAA,EAAY;EACzB,OAAO;IACLC,WAAW,EAAE,sBAAsB;IACnCC,QAAQ;IACRC;EACF,CAAC;EAED,SAASD,QAAQA,CAACE,MAAM,EAAE;IACxB,MAAMC,MAAM,GAAGC,UAAU,CAACF,MAAM,CAACG,MAAM,CAAC;IACxC,IAAIF,MAAM,CAACG,MAAM,GAAG,CAA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CAACgB,MAAM,CAAC,CAAClB,MAAM,EAAES,KAAK,KAAK;MACtC,IAAIA,KAAK,CAACM,SAAS,EAAE;QACnB,IAAIN,KAAK,CAACM,SAAS,CAACZ,MAAM,KAAK,CAAC,EAAE;UAChC,OAAOH,MAAM,CAACmB,MAAM,CAAC;YAACV,KAAK;YAAED,IAAI,EAAEhB,MAAM,CAACC;UAAe,CAAC,CAAC;QAC7D;QAEA,MAAM2B,qBAAqB,GAAGX,KAAK,CAACM,SAAS,CAACM,MAAM,CAACT,EAAE,IAAI,CAACA,EAAE,CAACU,KAAK,CAAC;QAErE,IAAIF,qBAAqB,CAACjB,MAAM,GAAG,CAAC,EAAE;UACpC,OAAOH,MAAM,CAACmB,MAAM,CAAC;YACnBV,KAAK;YACLE,cAAc,EAAES,qBAAqB;YACrCZ,IAAI,EAAEhB,MAAM,CAACE;UACf,CAAC,CAAC;QACJ;MACF;MAEA,OAAOM,MAAM;IACf,CAAC,EAAE,EAAE,CAAC;EACR;AACF"}
|
|
@@ -1,28 +1,114 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _chai = require("chai");
|
|
4
|
+
var _marcRecord = require("@natlibfi/marc-record");
|
|
5
|
+
var _emptyFields = _interopRequireDefault(require("../src/empty-fields"));
|
|
6
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
7
|
+
before(() => {
|
|
8
|
+
_marcRecord.MarcRecord.setValidationOptions({
|
|
9
|
+
subfields: false,
|
|
10
|
+
subfieldValues: false
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
after(() => {
|
|
14
|
+
_marcRecord.MarcRecord.setValidationOptions({});
|
|
15
|
+
});
|
|
16
|
+
describe('empty-fields', () => {
|
|
17
|
+
it('Creates a validator', async () => {
|
|
18
|
+
const validator = await (0, _emptyFields.default)();
|
|
19
|
+
(0, _chai.expect)(validator).to.be.an('object').that.has.any.keys('description', 'validate');
|
|
20
|
+
(0, _chai.expect)(validator.description).to.be.a('string');
|
|
21
|
+
(0, _chai.expect)(validator.validate).to.be.a('function');
|
|
22
|
+
});
|
|
23
|
+
describe('#validate', () => {
|
|
24
|
+
it('Finds the record valid', async () => {
|
|
25
|
+
const validator = await (0, _emptyFields.default)();
|
|
26
|
+
const record = new _marcRecord.MarcRecord({
|
|
27
|
+
fields: [{
|
|
28
|
+
tag: '001',
|
|
29
|
+
value: '1234567',
|
|
30
|
+
subfields: [{
|
|
31
|
+
code: 'a',
|
|
32
|
+
value: 'foo'
|
|
33
|
+
}]
|
|
34
|
+
}]
|
|
35
|
+
});
|
|
36
|
+
const result = await validator.validate(record);
|
|
37
|
+
(0, _chai.expect)(result).to.to.have.property('valid', true);
|
|
38
|
+
});
|
|
39
|
+
it('Finds a missing subfield value', async () => {
|
|
40
|
+
const validator = await (0, _emptyFields.default)();
|
|
41
|
+
const record = new _marcRecord.MarcRecord({
|
|
42
|
+
fields: [{
|
|
43
|
+
tag: '245',
|
|
44
|
+
subfields: [{
|
|
45
|
+
code: 'a'
|
|
46
|
+
}]
|
|
47
|
+
}]
|
|
48
|
+
});
|
|
49
|
+
const result = await validator.validate(record);
|
|
50
|
+
(0, _chai.expect)(result).to.eql({
|
|
51
|
+
valid: false,
|
|
52
|
+
messages: ['Field 245 has missing subfield values: a']
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
it('Finds an empty subfield array', async () => {
|
|
56
|
+
const validator = await (0, _emptyFields.default)();
|
|
57
|
+
const record = new _marcRecord.MarcRecord({
|
|
58
|
+
fields: [{
|
|
59
|
+
tag: '500',
|
|
60
|
+
subfields: []
|
|
61
|
+
}]
|
|
62
|
+
});
|
|
63
|
+
const result = await validator.validate(record);
|
|
64
|
+
(0, _chai.expect)(result).to.eql({
|
|
65
|
+
valid: false,
|
|
66
|
+
messages: ['Field 500 has no subfields']
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
describe('#fix', () => {
|
|
71
|
+
it('Removes a subfield with missing value', async () => {
|
|
72
|
+
const validator = await (0, _emptyFields.default)();
|
|
73
|
+
const record = new _marcRecord.MarcRecord({
|
|
74
|
+
fields: [{
|
|
75
|
+
tag: '245',
|
|
76
|
+
subfields: [{
|
|
77
|
+
code: 'a',
|
|
78
|
+
value: 'foo'
|
|
79
|
+
}, {
|
|
80
|
+
code: 'b'
|
|
81
|
+
}]
|
|
82
|
+
}]
|
|
83
|
+
});
|
|
84
|
+
await validator.fix(record);
|
|
85
|
+
(0, _chai.expect)(record.fields).to.eql([{
|
|
86
|
+
tag: '245',
|
|
87
|
+
ind1: ' ',
|
|
88
|
+
ind2: ' ',
|
|
89
|
+
subfields: [{
|
|
90
|
+
code: 'a',
|
|
91
|
+
value: 'foo'
|
|
92
|
+
}]
|
|
93
|
+
}]);
|
|
94
|
+
});
|
|
95
|
+
it('Removes a field with no subfields', async () => {
|
|
96
|
+
const validator = await (0, _emptyFields.default)();
|
|
97
|
+
const record = new _marcRecord.MarcRecord({
|
|
98
|
+
fields: [{
|
|
99
|
+
tag: '001',
|
|
100
|
+
value: '1234567'
|
|
101
|
+
}, {
|
|
102
|
+
tag: '500',
|
|
103
|
+
subfields: []
|
|
104
|
+
}]
|
|
105
|
+
});
|
|
106
|
+
await validator.fix(record);
|
|
107
|
+
(0, _chai.expect)(record.fields).to.eql([{
|
|
108
|
+
tag: '001',
|
|
109
|
+
value: '1234567'
|
|
110
|
+
}]);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
});
|
|
28
114
|
//# sourceMappingURL=empty-fields.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"empty-fields.spec.js","names":["_chai","require","_marcRecord","_emptyFields","_interopRequireDefault","obj","__esModule","default","before","MarcRecord","setValidationOptions","subfields","subfieldValues","after","describe","it","validator","validatorFactory","expect","to","be","an","that","has","any","keys","description","a","validate","record","fields","tag","value","code","result","have","property","eql","valid","messages","fix","ind1","ind2"],"sources":["../src/empty-fields.spec.js"],"sourcesContent":["import {expect} from 'chai';\nimport {MarcRecord} from '@natlibfi/marc-record';\nimport validatorFactory from '../src/empty-fields';\n\nbefore(() => {\n MarcRecord.setValidationOptions({subfields: false, subfieldValues: false});\n});\n\nafter(() => {\n MarcRecord.setValidationOptions({});\n});\n\ndescribe('empty-fields', () => {\n it('Creates a validator', async () => {\n const validator = await validatorFactory();\n\n expect(validator)\n .to.be.an('object')\n .that.has.any.keys('description', 'validate');\n\n expect(validator.description).to.be.a('string');\n expect(validator.validate).to.be.a('function');\n });\n\n describe('#validate', () => {\n it('Finds the record valid', async () => {\n const validator = await validatorFactory();\n const record = new MarcRecord({\n fields: [\n {\n tag: '001',\n value: '1234567',\n subfields: [\n {\n code: 'a',\n value: 'foo'\n }\n ]\n }\n ]\n });\n const result = await validator.validate(record);\n expect(result).to.to.have.property('valid', true);\n });\n\n it('Finds a missing subfield value', async () => {\n const validator = await validatorFactory();\n const record = new MarcRecord({\n fields: [\n {\n tag: '245',\n subfields: [\n {\n code: 'a'\n }\n ]\n }\n ]\n });\n const result = await validator.validate(record);\n\n expect(result).to.eql({valid: false, messages: ['Field 245 has missing subfield values: a']});\n });\n\n it('Finds an empty subfield array', async () => {\n const validator = await validatorFactory();\n const record = new MarcRecord({\n fields: [\n {\n tag: '500',\n subfields: []\n }\n ]\n });\n const result = await validator.validate(record);\n\n expect(result).to.eql({valid: false, messages: ['Field 500 has no subfields']});\n });\n });\n\n describe('#fix', () => {\n it('Removes a subfield with missing value', async () => {\n const validator = await validatorFactory();\n const record = new MarcRecord({\n fields: [\n {\n tag: '245',\n subfields: [\n {\n code: 'a',\n value: 'foo'\n },\n {\n code: 'b'\n }\n ]\n }\n ]\n });\n await validator.fix(record);\n\n expect(record.fields).to.eql([\n {\n tag: '245',\n ind1: ' ',\n ind2: ' ',\n subfields: [\n {\n code: 'a',\n value: 'foo'\n }\n ]\n }\n ]);\n });\n\n it('Removes a field with no subfields', async () => {\n const validator = await validatorFactory();\n const record = new MarcRecord({\n fields: [\n {\n tag: '001',\n value: '1234567'\n },\n {\n tag: '500',\n subfields: []\n }\n ]\n });\n await validator.fix(record);\n\n expect(record.fields).to.eql([\n {\n tag: '001',\n value: '1234567'\n }\n ]);\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAmD,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEnDG,MAAM,CAAC,MAAM;EACXC,sBAAU,CAACC,oBAAoB,CAAC;IAACC,SAAS,EAAE,KAAK;IAAEC,cAAc,EAAE;EAAK,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEFC,KAAK,CAAC,MAAM;EACVJ,sBAAU,CAACC,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC,CAAC;AAEFI,QAAQ,CAAC,cAAc,EAAE,MAAM;EAC7BC,EAAE,CAAC,qBAAqB,EAAE,YAAY;IACpC,MAAMC,SAAS,GAAG,MAAM,IAAAC,oBAAgB,EAAC,CAAC;IAE1C,IAAAC,YAAM,EAACF,SAAS,CAAC,CACdG,EAAE,CAACC,EAAE,CAACC,EAAE,CAAC,QAAQ,CAAC,CAClBC,IAAI,CAACC,GAAG,CAACC,GAAG,CAACC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