@natlibfi/marc-record-merge 6.0.0-beta.8 → 7.0.0-alpha.1

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 (63) hide show
  1. package/.github/CODEOWNERS +2 -9
  2. package/.github/dependabot.yml +2 -3
  3. package/.github/workflows/melinda-node-tests.yml +2 -2
  4. package/README.md +16 -0
  5. package/dist/index.js +49 -4
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.spec.js +59 -0
  8. package/dist/index.spec.js.map +1 -0
  9. package/dist/reducers/copy.js +59 -148
  10. package/dist/reducers/copy.js.map +1 -1
  11. package/dist/reducers/copy.spec.js +9 -12
  12. package/dist/reducers/copy.spec.js.map +1 -1
  13. package/dist/reducers/copy2.spec.js +66 -0
  14. package/dist/reducers/copy2.spec.js.map +1 -0
  15. package/dist/reducers/index.js +0 -6
  16. package/dist/reducers/index.js.map +1 -1
  17. package/dist/reducers/select.js +43 -40
  18. package/dist/reducers/select.js.map +1 -1
  19. package/dist/reducers/select.spec.js +4 -15
  20. package/dist/reducers/select.spec.js.map +1 -1
  21. package/dist/reducers/select2.spec.js +58 -0
  22. package/dist/reducers/select2.spec.js.map +1 -0
  23. package/package.json +18 -18
  24. package/src/index.js +51 -1
  25. package/src/index.spec.js +45 -0
  26. package/src/reducers/copy.js +42 -103
  27. package/src/reducers/copy.spec.js +4 -6
  28. package/src/reducers/copy2.spec.js +55 -0
  29. package/src/reducers/select.js +31 -10
  30. package/src/reducers/select2.spec.js +49 -0
  31. package/test-fixtures/index/01/base.json +24 -0
  32. package/test-fixtures/index/01/merged.json +24 -0
  33. package/test-fixtures/index/01/metadata.json +8 -0
  34. package/test-fixtures/index/01/source.json +40 -0
  35. package/test-fixtures/index/02/base.json +24 -0
  36. package/test-fixtures/index/02/merged.json +24 -0
  37. package/test-fixtures/index/02/metadata.json +7 -0
  38. package/test-fixtures/index/02/source.json +40 -0
  39. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/03/metadata.json +6 -0
  40. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/04/base.json +20 -0
  41. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/04/merged.json +31 -0
  42. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/04/metadata.json +5 -0
  43. package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/04/source.json +20 -0
  44. package/test-fixtures/reducers/copy/11 - compareWithoutTag/01/base.json +28 -0
  45. package/test-fixtures/reducers/copy/11 - compareWithoutTag/01/merged.json +28 -0
  46. package/test-fixtures/reducers/copy/11 - compareWithoutTag/01/metadata.json +6 -0
  47. package/test-fixtures/reducers/copy/11 - compareWithoutTag/01/source.json +20 -0
  48. package/test-fixtures/reducers/copy/11 - compareWithoutTag/02/base.json +28 -0
  49. package/test-fixtures/reducers/copy/11 - compareWithoutTag/02/merged.json +39 -0
  50. package/test-fixtures/reducers/copy/11 - compareWithoutTag/02/metadata.json +6 -0
  51. package/test-fixtures/reducers/copy/11 - compareWithoutTag/02/source.json +31 -0
  52. package/test-fixtures/reducers/copy/11 - compareWithoutTag/03/base.json +28 -0
  53. package/test-fixtures/reducers/copy/11 - compareWithoutTag/03/merged.json +28 -0
  54. package/test-fixtures/reducers/copy/11 - compareWithoutTag/03/metadata.json +7 -0
  55. package/test-fixtures/reducers/copy/11 - compareWithoutTag/03/source.json +20 -0
  56. package/test-fixtures/reducers/copy/11 - compareWithoutTag/04/base.json +17 -0
  57. package/test-fixtures/reducers/copy/11 - compareWithoutTag/04/merged.json +28 -0
  58. package/test-fixtures/reducers/copy/11 - compareWithoutTag/04/metadata.json +7 -0
  59. package/test-fixtures/reducers/copy/11 - compareWithoutTag/04/source.json +31 -0
  60. package/test-fixtures/reducers/copy/11 - compareWithoutTag/05/base.json +28 -0
  61. package/test-fixtures/reducers/copy/11 - compareWithoutTag/05/merged.json +28 -0
  62. package/test-fixtures/reducers/copy/11 - compareWithoutTag/05/metadata.json +7 -0
  63. package/test-fixtures/reducers/copy/11 - compareWithoutTag/05/source.json +28 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "description": "compare fields 100 and 700, compareWithoutTag, if copied: swapTag 700: copy source 700 just once",
3
+ "tagPatternRegExp": "^(?<tags>100|700)$",
4
+ "compareWithoutTag": true,
5
+ "swapTag": [{"from": "^100$", "to": "700"}],
6
+ "only": false
7
+ }
@@ -0,0 +1,31 @@
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
+ "tag": "700",
21
+ "ind1": " ",
22
+ "ind2": " ",
23
+ "subfields": [
24
+ {
25
+ "code": "a",
26
+ "value": "test"
27
+ }
28
+ ]
29
+ }
30
+ ]
31
+ }
@@ -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,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,7 @@
1
+ {
2
+ "description": "compare fields 100 and 700, compareWithoutTag, if copied: swapTag 700: base has 700 allready",
3
+ "tagPatternRegExp": "^(?<tags>100|700)$",
4
+ "compareWithoutTag": true,
5
+ "swapTag": [{"from": "^100$", "to": "700"}],
6
+ "only": false
7
+ }
@@ -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": "100",
18
+ "ind1": " ",
19
+ "ind2": " ",
20
+ "subfields": [
21
+ {
22
+ "code": "a",
23
+ "value": "test"
24
+ }
25
+ ]
26
+ }
27
+ ]
28
+ }