@natlibfi/marc-record-merge 6.0.0-beta.1 → 6.0.0-beta.11

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 (263) hide show
  1. package/.github/CODEOWNERS +9 -0
  2. package/.github/dependabot.yml +41 -0
  3. package/.github/workflows/melinda-node-tests.yml +60 -0
  4. package/LICENSE +21 -0
  5. package/README.md +122 -2
  6. package/dist/index.js +56 -42
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.spec.js +59 -0
  9. package/dist/index.spec.js.map +1 -0
  10. package/dist/reducers/copy.js +254 -80
  11. package/dist/reducers/copy.js.map +1 -1
  12. package/dist/reducers/copy.spec.js +57 -72
  13. package/dist/reducers/copy.spec.js.map +1 -1
  14. package/dist/reducers/copy2.spec.js +67 -0
  15. package/dist/reducers/copy2.spec.js.map +1 -0
  16. package/dist/reducers/index.js +13 -24
  17. package/dist/reducers/index.js.map +1 -1
  18. package/dist/reducers/select.js +63 -58
  19. package/dist/reducers/select.js.map +1 -1
  20. package/dist/reducers/select.spec.js +45 -92
  21. package/dist/reducers/select.spec.js.map +1 -1
  22. package/dist/reducers/select2.spec.js +58 -0
  23. package/dist/reducers/select2.spec.js.map +1 -0
  24. package/package.json +33 -32
  25. package/src/index.js +50 -32
  26. package/src/index.spec.js +45 -0
  27. package/src/reducers/copy.js +262 -80
  28. package/src/reducers/copy.spec.js +50 -48
  29. package/src/reducers/copy2.spec.js +55 -0
  30. package/src/reducers/index.js +3 -30
  31. package/src/reducers/select.js +53 -39
  32. package/src/reducers/select.spec.js +41 -56
  33. package/src/reducers/select2.spec.js +49 -0
  34. package/test-fixtures/index/01/base.json +24 -0
  35. package/test-fixtures/index/01/merged.json +24 -0
  36. package/test-fixtures/index/01/metadata.json +8 -0
  37. package/test-fixtures/index/01/source.json +40 -0
  38. package/test-fixtures/index/02/base.json +24 -0
  39. package/test-fixtures/index/02/merged.json +24 -0
  40. package/test-fixtures/index/02/metadata.json +7 -0
  41. package/test-fixtures/index/02/source.json +40 -0
  42. package/test-fixtures/reducers/copy/{01/base.json → 01 - copy/01/base.json } +1 -1
  43. package/test-fixtures/reducers/copy/{01 → 01 - copy/01}/merged.json +0 -0
  44. package/test-fixtures/reducers/copy/01 - copy/01/metadata.json +4 -0
  45. package/test-fixtures/reducers/copy/{01 → 01 - copy/01}/source.json +0 -0
  46. package/test-fixtures/reducers/copy/{02/source.json → 01 - copy/02/base.json} +0 -0
  47. package/test-fixtures/reducers/copy/{02 → 01 - copy/02}/merged.json +0 -0
  48. package/test-fixtures/reducers/copy/01 - copy/02/metadata.json +4 -0
  49. package/test-fixtures/reducers/copy/{02/base.json → 01 - copy/02/source.json } +1 -1
  50. package/test-fixtures/reducers/copy/{03/base.json → 01 - copy/03/base.json } +1 -1
  51. package/test-fixtures/reducers/copy/{03 → 01 - copy/03}/merged.json +0 -0
  52. package/test-fixtures/reducers/copy/01 - copy/03/metadata.json +4 -0
  53. package/test-fixtures/reducers/copy/{03 → 01 - copy/03}/source.json +0 -0
  54. package/test-fixtures/reducers/copy/{05/base.json → 01 - copy/04/base.json } +1 -1
  55. package/test-fixtures/reducers/copy/{04/merged.json → 01 - copy/04/merged.json } +1 -1
  56. package/test-fixtures/reducers/copy/01 - copy/04/metadata.json +4 -0
  57. package/test-fixtures/reducers/copy/{04/source.json → 01 - copy/04/source.json } +1 -1
  58. package/test-fixtures/reducers/copy/{04/base.json → 01 - copy/05/base.json } +1 -1
  59. package/test-fixtures/reducers/copy/01 - copy/05/merged.json +77 -0
  60. package/test-fixtures/reducers/copy/01 - copy/05/metadata.json +4 -0
  61. package/test-fixtures/reducers/copy/01 - copy/05/source.json +62 -0
  62. package/test-fixtures/reducers/copy/01 - copy/06/base.json +24 -0
  63. package/test-fixtures/reducers/copy/01 - copy/06/merged.json +39 -0
  64. package/test-fixtures/reducers/copy/01 - copy/06/metadata.json +4 -0
  65. package/test-fixtures/reducers/copy/01 - copy/06/source.json +24 -0
  66. package/test-fixtures/reducers/copy/01 - copy/07/base.json +39 -0
  67. package/test-fixtures/reducers/copy/01 - copy/07/merged.json +39 -0
  68. package/test-fixtures/reducers/copy/01 - copy/07/metadata.json +5 -0
  69. package/test-fixtures/reducers/copy/01 - copy/07/source.json +24 -0
  70. package/test-fixtures/reducers/copy/01 - copy/08/base.json +28 -0
  71. package/test-fixtures/reducers/copy/01 - copy/08/merged.json +28 -0
  72. package/test-fixtures/reducers/copy/01 - copy/08/metadata.json +4 -0
  73. package/test-fixtures/reducers/copy/01 - copy/08/source.json +24 -0
  74. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/base.json +17 -0
  75. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/merged.json +20 -0
  76. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/metadata.json +6 -0
  77. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/source.json +20 -0
  78. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/base.json +9 -0
  79. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/merged.json +20 -0
  80. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/metadata.json +6 -0
  81. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/source.json +20 -0
  82. package/test-fixtures/reducers/copy/03 - compareTagsOnly/01/base.json +24 -0
  83. package/test-fixtures/reducers/copy/03 - compareTagsOnly/01/merged.json +24 -0
  84. package/test-fixtures/reducers/copy/03 - compareTagsOnly/01/metadata.json +5 -0
  85. package/test-fixtures/reducers/copy/03 - compareTagsOnly/01/source.json +24 -0
  86. package/test-fixtures/reducers/copy/03 - compareTagsOnly/02/base.json +24 -0
  87. package/test-fixtures/reducers/copy/03 - compareTagsOnly/02/merged.json +100 -0
  88. package/test-fixtures/reducers/copy/03 - compareTagsOnly/02/metadata.json +5 -0
  89. package/test-fixtures/reducers/copy/03 - compareTagsOnly/02/source.json +100 -0
  90. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/01/base.json +24 -0
  91. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/01/merged.json +24 -0
  92. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/01/metadata.json +5 -0
  93. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/01/source.json +24 -0
  94. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/02/base.json +24 -0
  95. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/02/merged.json +39 -0
  96. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/02/metadata.json +5 -0
  97. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/02/source.json +24 -0
  98. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/03/metadata.json +6 -0
  99. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/04/base.json +20 -0
  100. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/04/merged.json +31 -0
  101. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/04/metadata.json +5 -0
  102. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/04/source.json +20 -0
  103. package/test-fixtures/reducers/copy/05 - copyUnless/01/base.json +9 -0
  104. package/test-fixtures/reducers/copy/05 - copyUnless/01/merged.json +24 -0
  105. package/test-fixtures/reducers/copy/05 - copyUnless/01/metadata.json +5 -0
  106. package/test-fixtures/reducers/copy/05 - copyUnless/01/source.json +47 -0
  107. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/01/base.json +24 -0
  108. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/01/merged.json +39 -0
  109. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/01/metadata.json +5 -0
  110. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/01/source.json +24 -0
  111. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/02/base.json +24 -0
  112. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/02/merged.json +24 -0
  113. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/02/metadata.json +5 -0
  114. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/02/source.json +24 -0
  115. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/03/base.json +28 -0
  116. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/03/merged.json +43 -0
  117. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/03/metadata.json +5 -0
  118. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/03/source.json +24 -0
  119. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/04/base.json +28 -0
  120. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/04/merged.json +28 -0
  121. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/04/metadata.json +5 -0
  122. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/04/source.json +24 -0
  123. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/05/base.json +20 -0
  124. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/05/merged.json +35 -0
  125. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/05/metadata.json +5 -0
  126. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/05/source.json +24 -0
  127. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/06/base.json +20 -0
  128. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/06/merged.json +35 -0
  129. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/06/metadata.json +5 -0
  130. package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/06/source.json +24 -0
  131. package/test-fixtures/reducers/copy/07 - excludeSubfields/01/base.json +39 -0
  132. package/test-fixtures/reducers/copy/07 - excludeSubfields/01/merged.json +39 -0
  133. package/test-fixtures/reducers/copy/07 - excludeSubfields/01/metadata.json +8 -0
  134. package/test-fixtures/reducers/copy/{05/source.json → 07 - excludeSubfields/01/source.json } +1 -1
  135. package/test-fixtures/reducers/copy/07 - excludeSubfields/02/base.json +39 -0
  136. package/test-fixtures/reducers/copy/{05/merged.json → 07 - excludeSubfields/02/merged.json } +5 -5
  137. package/test-fixtures/reducers/copy/07 - excludeSubfields/02/metadata.json +5 -0
  138. package/test-fixtures/reducers/copy/07 - excludeSubfields/02/source.json +43 -0
  139. package/test-fixtures/reducers/copy/08 - dropSubfields/01/base.json +35 -0
  140. package/test-fixtures/reducers/copy/08 - dropSubfields/01/merged.json +54 -0
  141. package/test-fixtures/reducers/copy/08 - dropSubfields/01/metadata.json +5 -0
  142. package/test-fixtures/reducers/copy/08 - dropSubfields/01/source.json +43 -0
  143. package/test-fixtures/reducers/copy/08 - dropSubfields/02/base.json +43 -0
  144. package/test-fixtures/reducers/copy/08 - dropSubfields/02/merged.json +58 -0
  145. package/test-fixtures/reducers/copy/08 - dropSubfields/02/metadata.json +5 -0
  146. package/test-fixtures/reducers/copy/08 - dropSubfields/02/source.json +32 -0
  147. package/test-fixtures/reducers/copy/08 - dropSubfields/03/base.json +43 -0
  148. package/test-fixtures/reducers/copy/08 - dropSubfields/03/merged.json +58 -0
  149. package/test-fixtures/reducers/copy/08 - dropSubfields/03/metadata.json +5 -0
  150. package/test-fixtures/reducers/copy/08 - dropSubfields/03/source.json +32 -0
  151. package/test-fixtures/reducers/copy/08 - dropSubfields/04/base.json +43 -0
  152. package/test-fixtures/reducers/copy/08 - dropSubfields/04/merged.json +43 -0
  153. package/test-fixtures/reducers/copy/08 - dropSubfields/04/metadata.json +5 -0
  154. package/test-fixtures/reducers/copy/08 - dropSubfields/04/source.json +32 -0
  155. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/base.json +9 -0
  156. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/merged.json +20 -0
  157. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/metadata.json +6 -0
  158. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/source.json +20 -0
  159. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/base.json +9 -0
  160. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/merged.json +20 -0
  161. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/metadata.json +6 -0
  162. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/source.json +20 -0
  163. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/base.json +9 -0
  164. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/merged.json +31 -0
  165. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/metadata.json +6 -0
  166. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/source.json +31 -0
  167. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/base.json +9 -0
  168. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/merged.json +42 -0
  169. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/metadata.json +6 -0
  170. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/source.json +42 -0
  171. package/test-fixtures/reducers/copy/10 - swapTag/01/base.json +17 -0
  172. package/test-fixtures/reducers/copy/10 - swapTag/01/merged.json +28 -0
  173. package/test-fixtures/reducers/copy/10 - swapTag/01/metadata.json +6 -0
  174. package/test-fixtures/reducers/copy/10 - swapTag/01/source.json +20 -0
  175. package/test-fixtures/reducers/copy/11 - compareWithoutTag/01/base.json +28 -0
  176. package/test-fixtures/reducers/copy/11 - compareWithoutTag/01/merged.json +28 -0
  177. package/test-fixtures/reducers/copy/11 - compareWithoutTag/01/metadata.json +6 -0
  178. package/test-fixtures/reducers/copy/11 - compareWithoutTag/01/source.json +20 -0
  179. package/test-fixtures/reducers/copy/11 - compareWithoutTag/02/base.json +28 -0
  180. package/test-fixtures/reducers/copy/11 - compareWithoutTag/02/merged.json +39 -0
  181. package/test-fixtures/reducers/copy/11 - compareWithoutTag/02/metadata.json +6 -0
  182. package/test-fixtures/reducers/copy/11 - compareWithoutTag/02/source.json +31 -0
  183. package/test-fixtures/reducers/copy/11 - compareWithoutTag/03/base.json +28 -0
  184. package/test-fixtures/reducers/copy/11 - compareWithoutTag/03/merged.json +28 -0
  185. package/test-fixtures/reducers/copy/11 - compareWithoutTag/03/metadata.json +7 -0
  186. package/test-fixtures/reducers/copy/11 - compareWithoutTag/03/source.json +20 -0
  187. package/test-fixtures/reducers/copy/11 - compareWithoutTag/04/base.json +17 -0
  188. package/test-fixtures/reducers/copy/11 - compareWithoutTag/04/merged.json +28 -0
  189. package/test-fixtures/reducers/copy/11 - compareWithoutTag/04/metadata.json +7 -0
  190. package/test-fixtures/reducers/copy/11 - compareWithoutTag/04/source.json +31 -0
  191. package/test-fixtures/reducers/copy/11 - compareWithoutTag/05/base.json +28 -0
  192. package/test-fixtures/reducers/copy/11 - compareWithoutTag/05/merged.json +28 -0
  193. package/test-fixtures/reducers/copy/11 - compareWithoutTag/05/metadata.json +7 -0
  194. package/test-fixtures/reducers/copy/11 - compareWithoutTag/05/source.json +28 -0
  195. package/test-fixtures/reducers/metadata.json +4 -0
  196. package/test-fixtures/reducers/select/01/metadata.json +5 -0
  197. package/test-fixtures/reducers/select/02/metadata.json +4 -0
  198. package/test-fixtures/reducers/select/03/metadata.json +4 -0
  199. package/test-fixtures/reducers/select/04/metadata.json +5 -0
  200. package/test-fixtures/reducers/select/05/metadata.json +4 -0
  201. package/test-fixtures/reducers/select/06/base.json +4 -0
  202. package/test-fixtures/reducers/select/06/merged.json +4 -0
  203. package/test-fixtures/reducers/select/06/metadata.json +4 -0
  204. package/test-fixtures/reducers/select/06/source.json +4 -0
  205. package/test-fixtures/reducers/select/07/metadata.json +5 -0
  206. package/test-fixtures/reducers/select/08/metadata.json +4 -0
  207. package/test-fixtures/reducers/select/09/metadata.json +4 -0
  208. package/test-fixtures/reducers/select/10/metadata.json +5 -0
  209. package/test-fixtures/reducers/select/11/metadata.json +4 -0
  210. package/test-fixtures/reducers/select/12/metadata.json +5 -0
  211. package/test-fixtures/reducers/select/13/metadata.json +4 -0
  212. package/test-fixtures/reducers/select/14/base.json +24 -0
  213. package/test-fixtures/reducers/select/14/merged.json +24 -0
  214. package/test-fixtures/reducers/select/14/metadata.json +4 -0
  215. package/test-fixtures/reducers/select/14/source.json +24 -0
  216. package/.drone.yml +0 -92
  217. package/.nyc_output/7ecda3cd-9f84-4416-a466-fa1e5889c6a3.json +0 -1
  218. package/.nyc_output/processinfo/7ecda3cd-9f84-4416-a466-fa1e5889c6a3.json +0 -1
  219. package/.nyc_output/processinfo/index.json +0 -1
  220. package/LICENSE.txt +0 -165
  221. package/coverage/base.css +0 -224
  222. package/coverage/block-navigation.js +0 -79
  223. package/coverage/copy.js.html +0 -344
  224. package/coverage/favicon.png +0 -0
  225. package/coverage/index.html +0 -126
  226. package/coverage/lcov-report/base.css +0 -224
  227. package/coverage/lcov-report/block-navigation.js +0 -79
  228. package/coverage/lcov-report/copy.js.html +0 -344
  229. package/coverage/lcov-report/favicon.png +0 -0
  230. package/coverage/lcov-report/index.html +0 -126
  231. package/coverage/lcov-report/prettify.css +0 -1
  232. package/coverage/lcov-report/prettify.js +0 -2
  233. package/coverage/lcov-report/select.js.html +0 -431
  234. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  235. package/coverage/lcov-report/sorter.js +0 -170
  236. package/coverage/lcov.info +0 -195
  237. package/coverage/prettify.css +0 -1
  238. package/coverage/prettify.js +0 -2
  239. package/coverage/select.js.html +0 -431
  240. package/coverage/sort-arrow-sprite.png +0 -0
  241. package/coverage/sorter.js +0 -170
  242. package/test-fixtures/reducers/copy/01/pattern.txt +0 -1
  243. package/test-fixtures/reducers/copy/02/pattern.txt +0 -1
  244. package/test-fixtures/reducers/copy/03/pattern.txt +0 -1
  245. package/test-fixtures/reducers/copy/04/pattern.txt +0 -1
  246. package/test-fixtures/reducers/copy/05/pattern.txt +0 -1
  247. package/test-fixtures/reducers/select/01/expected-error.txt +0 -1
  248. package/test-fixtures/reducers/select/01/pattern.txt +0 -1
  249. package/test-fixtures/reducers/select/02/pattern.txt +0 -1
  250. package/test-fixtures/reducers/select/03/pattern.txt +0 -1
  251. package/test-fixtures/reducers/select/04/pattern.txt +0 -1
  252. package/test-fixtures/reducers/select/05/pattern.txt +0 -1
  253. package/test-fixtures/reducers/select/06/pattern.txt +0 -1
  254. package/test-fixtures/reducers/select/07/equalityFunction.txt +0 -1
  255. package/test-fixtures/reducers/select/07/pattern.txt +0 -1
  256. package/test-fixtures/reducers/select/08/pattern.txt +0 -1
  257. package/test-fixtures/reducers/select/09/pattern.txt +0 -1
  258. package/test-fixtures/reducers/select/10/equalityFunction.txt +0 -1
  259. package/test-fixtures/reducers/select/10/pattern.txt +0 -1
  260. package/test-fixtures/reducers/select/11/pattern.txt +0 -1
  261. package/test-fixtures/reducers/select/12/equalityFunction.txt +0 -1
  262. package/test-fixtures/reducers/select/12/pattern.txt +0 -1
  263. package/test-fixtures/reducers/select/13/pattern.txt +0 -1
@@ -1,52 +1,54 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * Merge MARC records
6
- *
7
- * Copyright (C) 2015-2019 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-merge-js
10
-
11
- * marc-record-merge-js program is free software: you can redistribute it and/or modify
12
- * it under the terms of the GNU Lesser General Public License as
13
- * published by the Free Software Foundation, either version 3 of the
14
- * License, or (at your option) any later version.
15
- *
16
- * marc-record-merge-js is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- * GNU Lesser General Public License for more details.
20
- *
21
- * You should have received a copy of the GNU Lesser General Public License
22
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
- *
24
- * @licend The above is the entire license notice
25
- * for the JavaScript code in this file.
26
- *
27
- */
28
- import chai from 'chai';
29
- import fs from 'fs';
30
- import path from 'path';
31
- import {MarcRecord} from '@natlibfi/marc-record';
1
+ import {expect} from 'chai';
2
+ import {READERS} from '@natlibfi/fixura';
32
3
  import createReducer from './copy';
33
- import fixturesFactory, {READERS} from '@natlibfi/fixura';
34
-
35
- MarcRecord.setValidationOptions({subfieldValues: false});
4
+ import generateTests from '@natlibfi/fixugen';
36
5
 
37
- describe('reducers/copy', () => {
38
- const {expect} = chai;
39
- const fixturesPath = path.join(__dirname, '..', '..', 'test-fixtures', 'reducers', 'copy');
6
+ //import createDebugLogger from 'debug'; // <---
7
+ //const debug = createDebugLogger('@natlibfi/marc-record-merge/copy.spec.js'); // <---
40
8
 
41
- fs.readdirSync(fixturesPath).forEach(subDir => {
42
- const {getFixture} = fixturesFactory({root: [fixturesPath, subDir], reader: READERS.JSON});
43
- it(subDir, () => {
44
- const baseTest = new MarcRecord(getFixture('base.json'));
45
- const sourceTest = new MarcRecord(getFixture('source.json'));
46
- const patternTest = new RegExp(getFixture({components: ['pattern.txt'], reader: READERS.TEXT}), 'u');
47
- const expectedRecord = getFixture('merged.json');
48
- const mergedRecord = createReducer(patternTest)(baseTest, sourceTest);
49
- expect(mergedRecord.toObject()).to.eql(expectedRecord);
50
- });
51
- });
9
+ generateTests({
10
+ callback,
11
+ path: [__dirname, '..', '..', 'test-fixtures', 'reducers', 'copy'],
12
+ useMetadataFile: true,
13
+ recurse: true,
14
+ fixura: {
15
+ reader: READERS.JSON,
16
+ failWhenNotFound: false
17
+ }
52
18
  });
19
+
20
+ function callback({
21
+ getFixture,
22
+ tagPatternRegExp,
23
+ compareTagsOnly = false,
24
+ compareWithoutTag = false,
25
+ compareWithoutIndicators = false,
26
+ compareWithoutIndicator1 = false,
27
+ compareWithoutIndicator2 = false,
28
+ subfieldsMustBeIdentical = false,
29
+ copyUnless = undefined,
30
+ excludeSubfields = undefined,
31
+ dropSubfields = undefined,
32
+ swapSubfieldCode = [],
33
+ swapTag = [],
34
+ doNotCopyIfFieldPresent = false
35
+ }) {
36
+ const base = getFixture('base.json');
37
+ const source = getFixture('source.json');
38
+ const tagPattern = new RegExp(tagPatternRegExp, 'u');
39
+ const expectedRecord = getFixture('merged.json');
40
+
41
+ const merged = createReducer({
42
+ tagPattern, compareTagsOnly, compareWithoutTag, compareWithoutIndicators, compareWithoutIndicator1, compareWithoutIndicator2,
43
+ copyUnless, subfieldsMustBeIdentical, excludeSubfields,
44
+ dropSubfields, swapSubfieldCode, swapTag,
45
+ doNotCopyIfFieldPresent
46
+ })(base, source);
47
+ //debug(`*** mergedRecord: `, mergedRecord); //<--
48
+ //debug(`*** mergedRecord,Strfy: `, JSON.stringify(mergedRecord)); //<--
49
+ //debug(`*** expectedRecord: `, expectedRecord); //<--
50
+ //debug(`*** expectedRecord,Strfy: `, JSON.stringify(expectedRecord)); //<--
51
+ expect(merged.constructor.name).not.to.eql('MarcRecord');
52
+ expect(merged.constructor.name).to.eql('Object');
53
+ expect(merged).to.eql(expectedRecord);
54
+ }
@@ -0,0 +1,55 @@
1
+ import {expect} from 'chai';
2
+ import {READERS} from '@natlibfi/fixura';
3
+ import createReducer from './copy';
4
+ import generateTests from '@natlibfi/fixugen';
5
+
6
+ //import createDebugLogger from 'debug'; // <---
7
+ //const debug = createDebugLogger('@natlibfi/marc-record-merge/copy.spec.js'); // <---
8
+
9
+ generateTests({
10
+ callback,
11
+ path: [__dirname, '..', '..', 'test-fixtures', 'reducers', 'copy'],
12
+ useMetadataFile: true,
13
+ recurse: true,
14
+ fixura: {
15
+ reader: READERS.JSON,
16
+ failWhenNotFound: false
17
+ }
18
+ });
19
+
20
+
21
+ function callback({
22
+ getFixture,
23
+ tagPatternRegExp,
24
+ compareTagsOnly = false,
25
+ compareWithoutTag = false,
26
+ compareWithoutIndicators = false,
27
+ compareWithoutIndicator1 = false,
28
+ compareWithoutIndicator2 = false,
29
+ subfieldsMustBeIdentical = false,
30
+ copyUnless = undefined,
31
+ excludeSubfields = undefined,
32
+ dropSubfields = undefined,
33
+ swapSubfieldCode = [],
34
+ swapTag = [],
35
+ doNotCopyIfFieldPresent = false
36
+ }) {
37
+ const base = getFixture('base.json');
38
+ const source = getFixture('source.json');
39
+ const tagPattern = new RegExp(tagPatternRegExp, 'u');
40
+ const expectedRecord = getFixture('merged.json');
41
+
42
+ const merged = createReducer({
43
+ tagPattern, compareTagsOnly, compareWithoutTag, compareWithoutIndicators, compareWithoutIndicator1, compareWithoutIndicator2,
44
+ copyUnless, subfieldsMustBeIdentical, excludeSubfields,
45
+ dropSubfields, swapSubfieldCode, swapTag,
46
+ doNotCopyIfFieldPresent
47
+ })({base, source});
48
+ //debug(`*** mergedRecord: `, mergedRecord); //<--
49
+ //debug(`*** mergedRecord,Strfy: `, JSON.stringify(mergedRecord)); //<--
50
+ //debug(`*** expectedRecord: `, expectedRecord); //<--
51
+ //debug(`*** expectedRecord,Strfy: `, JSON.stringify(expectedRecord)); //<--
52
+ expect(merged.constructor.name).not.to.eql('MarcRecord');
53
+ expect(merged.constructor.name).to.eql('Object');
54
+ expect(merged).to.eql(expectedRecord);
55
+ }
@@ -1,31 +1,4 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * Merge MARC records
6
- *
7
- * Copyright (C) 2015-2019 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-merge-js
10
-
11
- * marc-record-merge-js program is free software: you can redistribute it and/or modify
12
- * it under the terms of the GNU Lesser General Public License as
13
- * published by the Free Software Foundation, either version 3 of the
14
- * License, or (at your option) any later version.
15
- *
16
- * marc-record-merge-js is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- * GNU Lesser General Public License for more details.
20
- *
21
- * You should have received a copy of the GNU Lesser General Public License
22
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
- *
24
- * @licend The above is the entire license notice
25
- * for the JavaScript code in this file.
26
- *
27
- */
28
-
29
- export * from './copy';
30
- export * from './select';
1
+ import copy from './copy';
2
+ import select, {strictEquality, subsetEquality} from './select';
31
3
 
4
+ export default {copy, select, strictEquality, subsetEquality};
@@ -1,57 +1,62 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * Merge MARC records
6
- *
7
- * Copyright (C) 2015-2019 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-merge-js
10
-
11
- * marc-record-merge-js program is free software: you can redistribute it and/or modify
12
- * it under the terms of the GNU Lesser General Public License as
13
- * published by the Free Software Foundation, either version 3 of the
14
- * License, or (at your option) any later version.
15
- *
16
- * marc-record-merge-js is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- * GNU Lesser General Public License for more details.
20
- *
21
- * You should have received a copy of the GNU Lesser General Public License
22
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
- *
24
- * @licend The above is the entire license notice
25
- * for the JavaScript code in this file.
26
- *
27
- */
28
1
  import {normalizeSync} from 'normalize-diacritics';
2
+ import createDebugLogger from 'debug';
3
+ import {MarcRecord} from '@natlibfi/marc-record';
29
4
 
30
5
  export function strictEquality(subfieldA, subfieldB) {
31
6
  return subfieldA.code === subfieldB.code &&
32
- subfieldA.value === subfieldB.value;
7
+ subfieldA.value === subfieldB.value;
33
8
  }
34
9
 
35
10
  export function subsetEquality(subfieldA, subfieldB) {
36
11
  return subfieldA.code === subfieldB.code &&
37
- (subfieldA.value.indexOf(subfieldB.value) !== -1 || subfieldB.value.indexOf(subfieldA.value) !== -1);
12
+ (subfieldA.value.indexOf(subfieldB.value) !== -1 || subfieldB.value.indexOf(subfieldA.value) !== -1);
38
13
  }
14
+ // EqualityFunction can be either strictEquality or subsetEquality
15
+
16
+ export default ({
17
+ tagPattern,
18
+ equalityFunction = strictEquality,
19
+ baseValidators = {subfieldValues: false},
20
+ sourceValidators = {subfieldValues: false}
21
+ // eslint-disable-next-line max-statements
22
+ }) => (base, source) => {
23
+ const debug = createDebugLogger('@natlibfi/marc-record-merge:select');
24
+
25
+ const {baseRecord, sourceRecord} = getRecordsFromParameters(base, source, baseValidators, sourceValidators);
26
+
27
+ function getRecordsFromParameters(base, source, baseValidators, sourceValidators) {
28
+ // records if we got an object ({base, source}) as a parameter
29
+ if (source === undefined && base.base !== undefined && base.source !== undefined) {
30
+ const baseRecord = new MarcRecord(base.base, baseValidators);
31
+ const sourceRecord = new MarcRecord(base.source, sourceValidators);
32
+ return {baseRecord, sourceRecord};
33
+ }
34
+ // records if we got an non-object (base, source) as a parameter
35
+ const baseRecord = new MarcRecord(base, baseValidators);
36
+ const sourceRecord = new MarcRecord(source, sourceValidators);
37
+ return {baseRecord, sourceRecord};
38
+ }
39
39
 
40
- export default ({pattern, equalityFunction = strictEquality}) => (base, source) => {
41
- const baseFields = base.get(pattern);
42
- const sourceFields = source.get(pattern);
40
+ const baseFields = baseRecord.get(tagPattern);
41
+ const sourceFields = sourceRecord.get(tagPattern);
42
+ const fieldTag = sourceFields.map(field => field.tag);
43
+ debug(`Comparing field ${fieldTag}`);
43
44
 
44
45
  checkFieldType(baseFields);
45
46
  checkFieldType(sourceFields);
46
47
 
47
48
  if (baseFields.length > 1 || sourceFields.length > 1) {
48
- return base;
49
+ debug(`Multiple fields in base or source`);
50
+ debug(`No changes to base`);
51
+ return baseRecord.toObject();
49
52
  }
50
53
  const [baseField] = baseFields;
51
54
  const [sourceField] = sourceFields;
52
55
 
53
56
  if (baseField.tag === sourceField.tag === false) {
54
- return base;
57
+ debug(`Base tag ${baseField.tag} is not equal to source tag ${sourceField.tag}`);
58
+ debug(`No changes to base`);
59
+ return baseRecord.toObject();
55
60
  }
56
61
  const baseSubs = baseField.subfields;
57
62
  const sourceSubs = sourceField.subfields;
@@ -62,19 +67,26 @@ export default ({pattern, equalityFunction = strictEquality}) => (base, source)
62
67
  const sourceSubsNormalized = sourceSubs
63
68
  .map(({code, value}) => ({code, value: normalizeSubfieldValue(value)}));
64
69
 
70
+ // Returns the base subfields for which a matching source subfield is found
65
71
  const equalSubfieldsBase = baseSubsNormalized
66
72
  .filter(baseSubfield => sourceSubsNormalized
67
73
  .some(sourceSubfield => equalityFunction(baseSubfield, sourceSubfield)));
74
+ debug(`equalSubfieldsBase: ${JSON.stringify(equalSubfieldsBase, undefined, 2)}`);
68
75
 
76
+ // Returns the source subfields for which a matching base subfield is found
69
77
  const equalSubfieldsSource = sourceSubsNormalized
70
78
  .filter(sourceSubfield => baseSubsNormalized
71
79
  .some(baseSubfield => equalityFunction(sourceSubfield, baseSubfield)));
80
+ debug(`equalSubfieldsSource: ${JSON.stringify(equalSubfieldsSource, undefined, 2)}`);
72
81
 
73
82
  if (baseSubs.length === sourceSubs.length && equalSubfieldsBase.length < baseSubs.length) {
74
- return base;
83
+ debug(`Base and source subfields are not equal`);
84
+ debug(`No changes to base`);
85
+ return baseRecord.toObject();
75
86
  }
76
87
 
77
88
  if (baseSubs.length === sourceSubs.length && equalSubfieldsBase.length === equalSubfieldsSource.length) {
89
+ debug(`Checking subfield equality`);
78
90
  const totalSubfieldLengthBase = baseSubsNormalized
79
91
  .map(({value}) => value.length)
80
92
  .reduce((acc, value) => acc + value);
@@ -83,19 +95,21 @@ export default ({pattern, equalityFunction = strictEquality}) => (base, source)
83
95
  .reduce((acc, value) => acc + value);
84
96
 
85
97
  if (totalSubfieldLengthSource > totalSubfieldLengthBase) {
86
- return replaceBasefieldWithSourcefield(base);
98
+ return replaceBasefieldWithSourcefield(baseRecord.toObject());
87
99
  }
88
100
  }
89
101
 
90
102
  if (sourceSubs.length > baseSubs.length && equalSubfieldsBase.length === baseSubs.length) {
91
- return replaceBasefieldWithSourcefield(base);
103
+ return replaceBasefieldWithSourcefield(baseRecord.toObject());
92
104
  }
93
105
 
94
- return base;
106
+ debug(`No changes to base`);
107
+ return baseRecord.toObject();
95
108
 
96
109
  function replaceBasefieldWithSourcefield(base) {
97
110
  const index = base.fields.findIndex(field => field === baseField);
98
111
  base.fields.splice(index, 1, sourceField); // eslint-disable-line functional/immutable-data
112
+ debug(`Source field is longer, replacing base with source`);
99
113
  return base;
100
114
  }
101
115
 
@@ -111,7 +125,7 @@ export default ({pattern, equalityFunction = strictEquality}) => (base, source)
111
125
 
112
126
  function normalizeSubfieldValue(value) {
113
127
  // Regexp options: g: global search, u: unicode
114
- const punctuation = /[.,\-/#!$%^&*;:{}=_`~()[\]]/gu;
128
+ const punctuation = /[.,\-/#!?$%^&*;:{}=_`~()[\]]/gu;
115
129
  return normalizeSync(value).toLowerCase().replace(punctuation, '', 'u').replace(/\s+/gu, ' ').trim();
116
130
  }
117
131
  };
@@ -1,64 +1,49 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * Merge MARC records
6
- *
7
- * Copyright (C) 2015-2019 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-merge-js
10
-
11
- * marc-record-merge-js program is free software: you can redistribute it and/or modify
12
- * it under the terms of the GNU Lesser General Public License as
13
- * published by the Free Software Foundation, either version 3 of the
14
- * License, or (at your option) any later version.
15
- *
16
- * marc-record-merge-js is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- * GNU Lesser General Public License for more details.
20
- *
21
- * You should have received a copy of the GNU Lesser General Public License
22
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
- *
24
- * @licend The above is the entire license notice
25
- * for the JavaScript code in this file.
26
- *
27
- */
28
- import chai from 'chai';
29
- import fs from 'fs';
30
- import path from 'path';
1
+ import {expect} from 'chai';
31
2
  import {MarcRecord} from '@natlibfi/marc-record';
32
3
  import createReducer, {subsetEquality} from './select';
33
- import fixturesFactory, {READERS} from '@natlibfi/fixura';
4
+ import {READERS} from '@natlibfi/fixura';
5
+ import generateTests from '@natlibfi/fixugen';
34
6
 
35
7
  MarcRecord.setValidationOptions({subfieldValues: false});
36
8
 
37
- describe('reducers/select', () => {
38
- const {expect} = chai;
39
- const fixturesPath = path.join(__dirname, '..', '..', 'test-fixtures', 'reducers', 'select');
9
+ generateTests({
10
+ callback,
11
+ path: [__dirname, '..', '..', 'test-fixtures', 'reducers', 'select'],
12
+ useMetadataFile: true,
13
+ recurse: false,
14
+ fixura: {
15
+ reader: READERS.JSON,
16
+ failWhenNotFound: false
17
+ }
18
+ });
40
19
 
41
- fs.readdirSync(fixturesPath).forEach(subDir => {
42
- const {getFixture} = fixturesFactory({root: [fixturesPath, subDir], reader: READERS.JSON, failWhenNotFound: false});
43
- it(subDir, () => {
44
- const baseTest = new MarcRecord(getFixture('base.json'));
45
- const sourceTest = new MarcRecord(getFixture('source.json'));
46
- const patternTest = new RegExp(getFixture({components: ['pattern.txt'], reader: READERS.TEXT}), 'u');
47
- const expectedRecord = getFixture('merged.json');
48
- const expectedError = getFixture({components: ['expected-error.txt'], reader: READERS.TEXT});
49
- const equalityFunction = getEqualityFunction();
20
+ function callback({
21
+ getFixture,
22
+ disabled = false,
23
+ tagPatternRegExp = false,
24
+ expectedError = false,
25
+ useSubsetEquality = false
26
+ }) {
27
+ if (disabled) {
28
+ console.log('TEST DISABLED!'); // eslint-disable-line no-console
29
+ return;
30
+ }
31
+ // const base = new MarcRecord(getFixture('base.json'), {subfieldValues: false});
32
+ // const source = new MarcRecord(getFixture('source.json'), {subfieldValues: false});
50
33
 
51
- if (expectedError) {
52
- expect(() => createReducer.to.throw(Error, 'control field'));
53
- return;
54
- }
55
- const mergedRecord = createReducer({pattern: patternTest, equalityFunction})(baseTest, sourceTest);
56
- expect(mergedRecord.toObject()).to.eql(expectedRecord);
34
+ const base = getFixture('base.json');
35
+ const source = getFixture('source.json');
57
36
 
58
- function getEqualityFunction() {
59
- const functionName = getFixture({components: ['equalityFunction.txt'], reader: READERS.TEXT});
60
- return functionName === 'subsetEquality' ? subsetEquality : undefined;
61
- }
62
- });
63
- });
64
- });
37
+ const tagPattern = new RegExp(tagPatternRegExp, 'u');
38
+ const expectedRecord = getFixture('merged.json');
39
+ const equalityFunction = useSubsetEquality ? subsetEquality : undefined;
40
+
41
+ // Bypass expected error in testing
42
+ if (expectedError) {
43
+ expect(() => createReducer.to.throw(Error, 'control field'));
44
+ return;
45
+ }
46
+
47
+ const mergedRecord = createReducer({tagPattern, equalityFunction})(base, source);
48
+ expect(mergedRecord).to.eql(expectedRecord);
49
+ }
@@ -0,0 +1,49 @@
1
+ import {expect} from 'chai';
2
+ import {MarcRecord} from '@natlibfi/marc-record';
3
+ import createReducer, {subsetEquality} from './select';
4
+ import {READERS} from '@natlibfi/fixura';
5
+ import generateTests from '@natlibfi/fixugen';
6
+
7
+ MarcRecord.setValidationOptions({subfieldValues: false});
8
+
9
+ generateTests({
10
+ callback,
11
+ path: [__dirname, '..', '..', 'test-fixtures', 'reducers', 'select'],
12
+ useMetadataFile: true,
13
+ recurse: false,
14
+ fixura: {
15
+ reader: READERS.JSON,
16
+ failWhenNotFound: false
17
+ }
18
+ });
19
+
20
+ function callback({
21
+ getFixture,
22
+ disabled = false,
23
+ tagPatternRegExp = false,
24
+ expectedError = false,
25
+ useSubsetEquality = false
26
+ }) {
27
+ if (disabled) {
28
+ console.log('TEST DISABLED!'); // eslint-disable-line no-console
29
+ return;
30
+ }
31
+ // const base = new MarcRecord(getFixture('base.json'), {subfieldValues: false});
32
+ // const source = new MarcRecord(getFixture('source.json'), {subfieldValues: false});
33
+
34
+ const base = getFixture('base.json');
35
+ const source = getFixture('source.json');
36
+
37
+ const tagPattern = new RegExp(tagPatternRegExp, 'u');
38
+ const expectedRecord = getFixture('merged.json');
39
+ const equalityFunction = useSubsetEquality ? subsetEquality : undefined;
40
+
41
+ // Bypass expected error in testing
42
+ if (expectedError) {
43
+ expect(() => createReducer.to.throw(Error, 'control field'));
44
+ return;
45
+ }
46
+
47
+ const mergedRecord = createReducer({tagPattern, equalityFunction})({base, source});
48
+ expect(mergedRecord).to.eql(expectedRecord);
49
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "001_base"
7
+ },
8
+ {
9
+ "tag": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "a",
15
+ "value": "010a_base"
16
+ },
17
+ {
18
+ "code": "b",
19
+ "value": "010b_base"
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "001_base"
7
+ },
8
+ {
9
+ "tag": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "a",
15
+ "value": "010a_base"
16
+ },
17
+ {
18
+ "code": "b",
19
+ "value": "010b_base"
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "description":"Reducers should run after each another - two reducers",
3
+ "reducerConfigs": [
4
+ {"tagPattern": "/010/u", "compareTagsOnly": true},
5
+ {"tagPattern": "/33./u"}
6
+
7
+ ]
8
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "001_sorsa"
7
+ },
8
+ {
9
+ "tag": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "a",
15
+ "value": "010a_sorsa"
16
+ },
17
+ {
18
+ "code": "b",
19
+ "value": "010b_sorsa"
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ "tag": "650",
25
+ "ind1": " ",
26
+ "ind2": "7",
27
+ "subfields": [
28
+ {
29
+ "code": "a",
30
+ "value": "poista mut"
31
+ },
32
+ {
33
+ "code": "2",
34
+ "value": "ysa"
35
+ }
36
+ ]
37
+ }
38
+
39
+ ]
40
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "001_base"
7
+ },
8
+ {
9
+ "tag": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "a",
15
+ "value": "010a_base"
16
+ },
17
+ {
18
+ "code": "b",
19
+ "value": "010b_base"
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "001_base"
7
+ },
8
+ {
9
+ "tag": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "a",
15
+ "value": "010a_base"
16
+ },
17
+ {
18
+ "code": "b",
19
+ "value": "010b_base"
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "description":"Reducers should run after each another - single reducer",
3
+ "reducerConfigs": [
4
+ {"tagPattern": "/33./u"}
5
+ ],
6
+ "skip": false
7
+ }