@natlibfi/marc-record-merge 6.0.0-beta.5 → 6.0.0-beta.6

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.
Files changed (139) hide show
  1. package/README.md +14 -0
  2. package/dist/reducers/copy.js +59 -3
  3. package/dist/reducers/copy.js.map +1 -1
  4. package/dist/reducers/copy.spec.js +7 -8
  5. package/dist/reducers/copy.spec.js.map +1 -1
  6. package/dist/reducers/select.js +10 -2
  7. package/dist/reducers/select.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/reducers/copy.js +51 -3
  10. package/src/reducers/copy.spec.js +9 -7
  11. package/src/reducers/select.js +7 -4
  12. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/01/base.json +0 -0
  13. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/01/merged.json +0 -0
  14. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/01/metadata.json +0 -0
  15. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/01/source.json +0 -0
  16. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/02/base.json +0 -0
  17. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/02/merged.json +0 -0
  18. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/02/metadata.json +0 -0
  19. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/02/source.json +0 -0
  20. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/03/base.json +0 -0
  21. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/03/merged.json +0 -0
  22. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/03/metadata.json +0 -0
  23. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/03/source.json +0 -0
  24. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/04/base.json +0 -0
  25. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/04/merged.json +0 -0
  26. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/04/metadata.json +0 -0
  27. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/04/source.json +0 -0
  28. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/05/base.json +0 -0
  29. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/05/merged.json +0 -0
  30. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/05/metadata.json +0 -0
  31. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/05/source.json +0 -0
  32. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/06/base.json +0 -0
  33. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/06/merged.json +0 -0
  34. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/06/metadata.json +0 -0
  35. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/06/source.json +0 -0
  36. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/07/base.json +0 -0
  37. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/07/merged.json +0 -0
  38. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/07/metadata.json +0 -0
  39. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/07/source.json +0 -0
  40. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/08/base.json +0 -0
  41. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/08/merged.json +0 -0
  42. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/08/metadata.json +0 -0
  43. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/08/source.json +0 -0
  44. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/base.json +17 -0
  45. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/merged.json +20 -0
  46. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/metadata.json +6 -0
  47. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/source.json +20 -0
  48. package/test-fixtures/reducers/copy/{copyUnless/01 → 02 - doNotCopyIfFieldPresent/02}/base.json +0 -0
  49. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/merged.json +20 -0
  50. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/metadata.json +6 -0
  51. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/source.json +20 -0
  52. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/01/base.json +0 -0
  53. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/01/merged.json +0 -0
  54. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/01/metadata.json +0 -0
  55. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/01/source.json +0 -0
  56. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/02/base.json +0 -0
  57. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/02/merged.json +0 -0
  58. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/02/metadata.json +0 -0
  59. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/02/source.json +0 -0
  60. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/01/base.json +0 -0
  61. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/01/merged.json +0 -0
  62. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/01/metadata.json +0 -0
  63. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/01/source.json +0 -0
  64. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/02/base.json +0 -0
  65. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/02/merged.json +0 -0
  66. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/02/metadata.json +0 -0
  67. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/02/source.json +0 -0
  68. package/test-fixtures/reducers/copy/05 - copyUnless/01/base.json +9 -0
  69. package/test-fixtures/reducers/copy/{copyUnless → 05 - copyUnless}/01/merged.json +0 -0
  70. package/test-fixtures/reducers/copy/{copyUnless → 05 - copyUnless}/01/metadata.json +0 -0
  71. package/test-fixtures/reducers/copy/{copyUnless → 05 - copyUnless}/01/source.json +0 -0
  72. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/01/base.json +0 -0
  73. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/01/merged.json +0 -0
  74. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/01/metadata.json +0 -0
  75. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/01/source.json +0 -0
  76. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/02/base.json +0 -0
  77. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/02/merged.json +0 -0
  78. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/02/metadata.json +0 -0
  79. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/02/source.json +0 -0
  80. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/03/base.json +0 -0
  81. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/03/merged.json +0 -0
  82. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/03/metadata.json +0 -0
  83. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/03/source.json +0 -0
  84. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/04/base.json +0 -0
  85. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/04/merged.json +0 -0
  86. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/04/metadata.json +0 -0
  87. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/04/source.json +0 -0
  88. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/05/base.json +0 -0
  89. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/05/merged.json +0 -0
  90. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/05/metadata.json +0 -0
  91. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/05/source.json +0 -0
  92. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/06/base.json +0 -0
  93. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/06/merged.json +0 -0
  94. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/06/metadata.json +0 -0
  95. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/06/source.json +0 -0
  96. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/01/base.json +0 -0
  97. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/01/merged.json +0 -0
  98. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/01/metadata.json +0 -0
  99. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/01/source.json +0 -0
  100. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/02/base.json +0 -0
  101. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/02/merged.json +0 -0
  102. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/02/metadata.json +0 -0
  103. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/02/source.json +0 -0
  104. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/01/base.json +0 -0
  105. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/01/merged.json +0 -0
  106. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/01/metadata.json +0 -0
  107. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/01/source.json +0 -0
  108. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/02/base.json +0 -0
  109. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/02/merged.json +0 -0
  110. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/02/metadata.json +0 -0
  111. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/02/source.json +0 -0
  112. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/03/base.json +0 -0
  113. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/03/merged.json +0 -0
  114. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/03/metadata.json +0 -0
  115. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/03/source.json +0 -0
  116. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/04/base.json +0 -0
  117. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/04/merged.json +0 -0
  118. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/04/metadata.json +0 -0
  119. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/04/source.json +0 -0
  120. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/base.json +9 -0
  121. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/merged.json +20 -0
  122. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/metadata.json +6 -0
  123. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/source.json +20 -0
  124. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/base.json +9 -0
  125. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/merged.json +20 -0
  126. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/metadata.json +6 -0
  127. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/source.json +20 -0
  128. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/base.json +9 -0
  129. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/merged.json +31 -0
  130. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/metadata.json +6 -0
  131. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/source.json +31 -0
  132. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/base.json +9 -0
  133. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/merged.json +42 -0
  134. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/metadata.json +6 -0
  135. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/source.json +42 -0
  136. package/test-fixtures/reducers/copy/10 - swapTag/01/base.json +17 -0
  137. package/test-fixtures/reducers/copy/10 - swapTag/01/merged.json +28 -0
  138. package/test-fixtures/reducers/copy/10 - swapTag/01/metadata.json +6 -0
  139. package/test-fixtures/reducers/copy/10 - swapTag/01/source.json +20 -0
@@ -0,0 +1,28 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "007346734"
7
+ },
8
+ {
9
+ "tag": "100",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {"code": "a", "value": "original"}
14
+ ]
15
+ },
16
+ {
17
+ "tag": "700",
18
+ "ind1": " ",
19
+ "ind2": " ",
20
+ "subfields": [
21
+ {
22
+ "code": "a",
23
+ "value": "test"
24
+ }
25
+ ]
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "Swap tag from 100 to 700 if copied: swapped",
3
+ "tagPatternRegExp": "^100$",
4
+ "swapTag": [{"from": "^100$", "to": "700"}],
5
+ "only": false
6
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "007346734"
7
+ },
8
+ {
9
+ "tag": "100",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "a",
15
+ "value": "test"
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }