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

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 (142) 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 +15 -17
  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/dist/reducers/select.spec.js +6 -8
  9. package/dist/reducers/select.spec.js.map +1 -1
  10. package/package.json +6 -6
  11. package/src/reducers/copy.js +51 -3
  12. package/src/reducers/copy.spec.js +18 -10
  13. package/src/reducers/select.js +7 -4
  14. package/src/reducers/select.spec.js +7 -3
  15. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/01/base.json +0 -0
  16. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/01/merged.json +0 -0
  17. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/01/metadata.json +0 -0
  18. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/01/source.json +0 -0
  19. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/02/base.json +0 -0
  20. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/02/merged.json +0 -0
  21. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/02/metadata.json +0 -0
  22. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/02/source.json +0 -0
  23. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/03/base.json +0 -0
  24. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/03/merged.json +0 -0
  25. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/03/metadata.json +0 -0
  26. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/03/source.json +0 -0
  27. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/04/base.json +0 -0
  28. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/04/merged.json +0 -0
  29. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/04/metadata.json +0 -0
  30. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/04/source.json +0 -0
  31. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/05/base.json +0 -0
  32. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/05/merged.json +0 -0
  33. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/05/metadata.json +0 -0
  34. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/05/source.json +0 -0
  35. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/06/base.json +0 -0
  36. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/06/merged.json +0 -0
  37. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/06/metadata.json +0 -0
  38. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/06/source.json +0 -0
  39. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/07/base.json +0 -0
  40. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/07/merged.json +0 -0
  41. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/07/metadata.json +0 -0
  42. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/07/source.json +0 -0
  43. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/08/base.json +0 -0
  44. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/08/merged.json +0 -0
  45. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/08/metadata.json +0 -0
  46. package/test-fixtures/reducers/copy/{basic copy → 01 - copy}/08/source.json +0 -0
  47. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/base.json +17 -0
  48. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/merged.json +20 -0
  49. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/metadata.json +6 -0
  50. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/source.json +20 -0
  51. package/test-fixtures/reducers/copy/{copyUnless/01 → 02 - doNotCopyIfFieldPresent/02}/base.json +0 -0
  52. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/merged.json +20 -0
  53. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/metadata.json +6 -0
  54. package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/source.json +20 -0
  55. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/01/base.json +0 -0
  56. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/01/merged.json +0 -0
  57. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/01/metadata.json +0 -0
  58. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/01/source.json +0 -0
  59. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/02/base.json +0 -0
  60. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/02/merged.json +0 -0
  61. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/02/metadata.json +0 -0
  62. package/test-fixtures/reducers/copy/{compareTagsOnly → 03 - compareTagsOnly}/02/source.json +0 -0
  63. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/01/base.json +0 -0
  64. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/01/merged.json +0 -0
  65. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/01/metadata.json +0 -0
  66. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/01/source.json +0 -0
  67. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/02/base.json +0 -0
  68. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/02/merged.json +0 -0
  69. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/02/metadata.json +0 -0
  70. package/test-fixtures/reducers/copy/{compareWithoutIndicators → 04 - compareWithoutIndicators}/02/source.json +0 -0
  71. package/test-fixtures/reducers/copy/05 - copyUnless/01/base.json +9 -0
  72. package/test-fixtures/reducers/copy/{copyUnless → 05 - copyUnless}/01/merged.json +0 -0
  73. package/test-fixtures/reducers/copy/{copyUnless → 05 - copyUnless}/01/metadata.json +0 -0
  74. package/test-fixtures/reducers/copy/{copyUnless → 05 - copyUnless}/01/source.json +0 -0
  75. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/01/base.json +0 -0
  76. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/01/merged.json +0 -0
  77. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/01/metadata.json +0 -0
  78. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/01/source.json +0 -0
  79. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/02/base.json +0 -0
  80. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/02/merged.json +0 -0
  81. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/02/metadata.json +0 -0
  82. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/02/source.json +0 -0
  83. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/03/base.json +0 -0
  84. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/03/merged.json +0 -0
  85. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/03/metadata.json +0 -0
  86. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/03/source.json +0 -0
  87. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/04/base.json +0 -0
  88. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/04/merged.json +0 -0
  89. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/04/metadata.json +0 -0
  90. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/04/source.json +0 -0
  91. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/05/base.json +0 -0
  92. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/05/merged.json +0 -0
  93. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/05/metadata.json +0 -0
  94. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/05/source.json +0 -0
  95. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/06/base.json +0 -0
  96. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/06/merged.json +0 -0
  97. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/06/metadata.json +0 -0
  98. package/test-fixtures/reducers/copy/{subfieldsMustBeIdentical → 06 - subfieldsMustBeIdentical}/06/source.json +0 -0
  99. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/01/base.json +0 -0
  100. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/01/merged.json +0 -0
  101. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/01/metadata.json +0 -0
  102. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/01/source.json +0 -0
  103. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/02/base.json +0 -0
  104. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/02/merged.json +0 -0
  105. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/02/metadata.json +0 -0
  106. package/test-fixtures/reducers/copy/{excludeSubfields → 07 - excludeSubfields}/02/source.json +0 -0
  107. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/01/base.json +0 -0
  108. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/01/merged.json +0 -0
  109. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/01/metadata.json +0 -0
  110. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/01/source.json +0 -0
  111. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/02/base.json +0 -0
  112. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/02/merged.json +0 -0
  113. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/02/metadata.json +0 -0
  114. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/02/source.json +0 -0
  115. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/03/base.json +0 -0
  116. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/03/merged.json +0 -0
  117. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/03/metadata.json +0 -0
  118. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/03/source.json +0 -0
  119. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/04/base.json +0 -0
  120. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/04/merged.json +0 -0
  121. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/04/metadata.json +0 -0
  122. package/test-fixtures/reducers/copy/{dropSubfields → 08 - dropSubfields}/04/source.json +0 -0
  123. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/base.json +9 -0
  124. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/merged.json +20 -0
  125. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/metadata.json +6 -0
  126. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/source.json +20 -0
  127. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/base.json +9 -0
  128. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/merged.json +20 -0
  129. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/metadata.json +6 -0
  130. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/source.json +20 -0
  131. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/base.json +9 -0
  132. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/merged.json +31 -0
  133. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/metadata.json +6 -0
  134. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/source.json +31 -0
  135. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/base.json +9 -0
  136. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/merged.json +42 -0
  137. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/metadata.json +6 -0
  138. package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/source.json +42 -0
  139. package/test-fixtures/reducers/copy/10 - swapTag/01/base.json +17 -0
  140. package/test-fixtures/reducers/copy/10 - swapTag/01/merged.json +28 -0
  141. package/test-fixtures/reducers/copy/10 - swapTag/01/metadata.json +6 -0
  142. package/test-fixtures/reducers/copy/10 - swapTag/01/source.json +20 -0
@@ -1,20 +1,23 @@
1
1
  import {normalizeSync} from 'normalize-diacritics';
2
2
  import createDebugLogger from 'debug';
3
+ import {MarcRecord} from '@natlibfi/marc-record';
3
4
 
4
5
  export function strictEquality(subfieldA, subfieldB) {
5
6
  return subfieldA.code === subfieldB.code &&
6
- subfieldA.value === subfieldB.value;
7
+ subfieldA.value === subfieldB.value;
7
8
  }
8
9
 
9
10
  export function subsetEquality(subfieldA, subfieldB) {
10
11
  return subfieldA.code === subfieldB.code &&
11
- (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);
12
13
  }
13
14
  // EqualityFunction can be either strictEquality or subsetEquality
14
15
  export default ({tagPattern, equalityFunction = strictEquality}) => (base, source) => {
15
16
  const debug = createDebugLogger('@natlibfi/marc-record-merge:select');
16
- const baseFields = base.get(tagPattern);
17
- const sourceFields = source.get(tagPattern);
17
+ const baseRecord = new MarcRecord(base, {subfieldValues: false});
18
+ const sourceRecord = new MarcRecord(source, {subfieldValues: false});
19
+ const baseFields = baseRecord.get(tagPattern);
20
+ const sourceFields = sourceRecord.get(tagPattern);
18
21
  const fieldTag = sourceFields.map(field => field.tag);
19
22
  debug(`Comparing field ${fieldTag}`);
20
23
 
@@ -28,8 +28,12 @@ function callback({
28
28
  console.log('TEST DISABLED!'); // eslint-disable-line no-console
29
29
  return;
30
30
  }
31
- const base = new MarcRecord(getFixture('base.json'), {subfieldValues: false});
32
- const source = new MarcRecord(getFixture('source.json'), {subfieldValues: false});
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
+
33
37
  const tagPattern = new RegExp(tagPatternRegExp, 'u');
34
38
  const expectedRecord = getFixture('merged.json');
35
39
  const equalityFunction = useSubsetEquality ? subsetEquality : undefined;
@@ -41,5 +45,5 @@ function callback({
41
45
  }
42
46
 
43
47
  const mergedRecord = createReducer({tagPattern, equalityFunction})(base, source);
44
- expect(mergedRecord.toObject()).to.eql(expectedRecord);
48
+ expect(mergedRecord).to.eql(expectedRecord);
45
49
  }
@@ -0,0 +1,17 @@
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": "test"}
14
+ ]
15
+ }
16
+ ]
17
+ }
@@ -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
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "Copy field 010 if f100 not present: f100 present",
3
+ "tagPatternRegExp": "^010$",
4
+ "doNotCopyIfFieldPresent": "^100$",
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": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "a",
15
+ "value": "##2002021346"
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "007346734"
7
+ },
8
+ {
9
+ "tag": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "a",
15
+ "value": "##2002021346"
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "Copy field 010 if f100 not present: f100 not present",
3
+ "tagPatternRegExp": "^010$",
4
+ "doNotCopyIfFieldPresent": "^100$",
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": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "a",
15
+ "value": "##2002021346"
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "007346734"
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "007346734"
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "007346734"
7
+ },
8
+ {
9
+ "tag": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "b",
15
+ "value": "##2002021346"
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "Swap subfield code from a to b if copied: swapped",
3
+ "tagPatternRegExp": "^010$",
4
+ "swapSubfieldCode": [{"from": "a", "to": "b"}],
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": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "a",
15
+ "value": "##2002021346"
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "007346734"
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "007346734"
7
+ },
8
+ {
9
+ "tag": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "c",
15
+ "value": "##2002021346"
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "Swap subfield code from a to b if copied: no 'a' found",
3
+ "tagPatternRegExp": "^010$",
4
+ "swapSubfieldCode": [{"from": "a", "to": "b"}],
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": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "c",
15
+ "value": "##2002021346"
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "007346734"
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ {
5
+ "tag": "001",
6
+ "value": "007346734"
7
+ },
8
+ {
9
+ "tag": "010",
10
+ "ind1": " ",
11
+ "ind2": " ",
12
+ "subfields": [
13
+ {
14
+ "code": "b",
15
+ "value": "##2002021346"
16
+ }
17
+ ]
18
+ },
19
+ {
20
+ "tag": "010",
21
+ "ind1": " ",
22
+ "ind2": " ",
23
+ "subfields": [
24
+ {
25
+ "code": "b",
26
+ "value": "##2002021f46"
27
+ }
28
+ ]
29
+ }
30
+ ]
31
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "Swap subfield code from a to b if copied: multiple 'a' swapped",
3
+ "tagPatternRegExp": "^010$",
4
+ "swapSubfieldCode": [{"from": "a", "to": "b"}],
5
+ "only": false
6
+ }