@natlibfi/marc-record-merge 6.0.0-beta.2 → 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.
- package/.github/CODEOWNERS +9 -0
- package/.github/dependabot.yml +41 -0
- package/.github/workflows/melinda-node-tests.yml +60 -0
- package/LICENSE +21 -0
- package/README.md +106 -2
- package/dist/index.js +2 -37
- package/dist/index.js.map +1 -1
- package/dist/reducers/copy.js +310 -109
- package/dist/reducers/copy.js.map +1 -1
- package/dist/reducers/copy.spec.js +52 -99
- package/dist/reducers/copy.spec.js.map +1 -1
- package/dist/reducers/index.js +0 -27
- package/dist/reducers/index.js.map +1 -1
- package/dist/reducers/select.js +12 -50
- package/dist/reducers/select.js.map +1 -1
- package/dist/reducers/select.spec.js +49 -83
- package/dist/reducers/select.spec.js.map +1 -1
- package/package.json +30 -27
- package/src/index.js +1 -33
- package/src/reducers/copy.js +306 -115
- package/src/reducers/copy.spec.js +44 -66
- package/src/reducers/index.js +0 -27
- package/src/reducers/select.js +8 -51
- package/src/reducers/select.spec.js +37 -58
- package/test-fixtures/reducers/copy/{01/base.json → 01 - copy/01/base.json } +1 -1
- package/test-fixtures/reducers/copy/{01 → 01 - copy/01}/merged.json +0 -0
- package/test-fixtures/reducers/copy/01 - copy/01/metadata.json +4 -0
- package/test-fixtures/reducers/copy/{01 → 01 - copy/01}/source.json +0 -0
- package/test-fixtures/reducers/copy/{02/source.json → 01 - copy/02/base.json} +0 -0
- package/test-fixtures/reducers/copy/{02 → 01 - copy/02}/merged.json +0 -0
- package/test-fixtures/reducers/copy/01 - copy/02/metadata.json +4 -0
- package/test-fixtures/reducers/copy/{02/base.json → 01 - copy/02/source.json } +1 -1
- package/test-fixtures/reducers/copy/{03/base.json → 01 - copy/03/base.json } +1 -1
- package/test-fixtures/reducers/copy/{03 → 01 - copy/03}/merged.json +0 -0
- package/test-fixtures/reducers/copy/01 - copy/03/metadata.json +4 -0
- package/test-fixtures/reducers/copy/{03 → 01 - copy/03}/source.json +0 -0
- package/test-fixtures/reducers/copy/{05/base.json → 01 - copy/04/base.json } +1 -1
- package/test-fixtures/reducers/copy/{04/merged.json → 01 - copy/04/merged.json } +1 -1
- package/test-fixtures/reducers/copy/01 - copy/04/metadata.json +4 -0
- package/test-fixtures/reducers/copy/{04/source.json → 01 - copy/04/source.json } +1 -1
- package/test-fixtures/reducers/copy/{04/base.json → 01 - copy/05/base.json } +1 -1
- package/test-fixtures/reducers/copy/{05 → 01 - copy/05}/merged.json +0 -0
- package/test-fixtures/reducers/copy/01 - copy/05/metadata.json +4 -0
- package/test-fixtures/reducers/copy/{05 → 01 - copy/05}/source.json +0 -0
- package/test-fixtures/reducers/copy/01 - copy/06/base.json +24 -0
- package/test-fixtures/reducers/copy/01 - copy/06/merged.json +39 -0
- package/test-fixtures/reducers/copy/01 - copy/06/metadata.json +4 -0
- package/test-fixtures/reducers/copy/01 - copy/06/source.json +24 -0
- package/test-fixtures/reducers/copy/01 - copy/07/base.json +39 -0
- package/test-fixtures/reducers/copy/01 - copy/07/merged.json +39 -0
- package/test-fixtures/reducers/copy/01 - copy/07/metadata.json +5 -0
- package/test-fixtures/reducers/copy/01 - copy/07/source.json +24 -0
- package/test-fixtures/reducers/copy/01 - copy/08/base.json +28 -0
- package/test-fixtures/reducers/copy/01 - copy/08/merged.json +28 -0
- package/test-fixtures/reducers/copy/01 - copy/08/metadata.json +4 -0
- package/test-fixtures/reducers/copy/01 - copy/08/source.json +24 -0
- package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/base.json +17 -0
- package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/merged.json +20 -0
- package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/metadata.json +6 -0
- package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/01/source.json +20 -0
- package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/base.json +9 -0
- package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/merged.json +20 -0
- package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/metadata.json +6 -0
- package/test-fixtures/reducers/copy/02 - doNotCopyIfFieldPresent/02/source.json +20 -0
- package/test-fixtures/reducers/copy/{06 → 03 - compareTagsOnly/01}/base.json +0 -0
- package/test-fixtures/reducers/copy/{06 → 03 - compareTagsOnly/01}/merged.json +0 -0
- package/test-fixtures/reducers/copy/03 - compareTagsOnly/01/metadata.json +5 -0
- package/test-fixtures/reducers/copy/{06 → 03 - compareTagsOnly/01}/source.json +0 -0
- package/test-fixtures/reducers/copy/{09 → 03 - compareTagsOnly/02}/base.json +0 -0
- package/test-fixtures/reducers/copy/{09 → 03 - compareTagsOnly/02}/merged.json +0 -0
- package/test-fixtures/reducers/copy/03 - compareTagsOnly/02/metadata.json +5 -0
- package/test-fixtures/reducers/copy/{09 → 03 - compareTagsOnly/02}/source.json +0 -0
- package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/01/base.json +24 -0
- package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/01/merged.json +24 -0
- package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/01/metadata.json +5 -0
- package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/01/source.json +24 -0
- package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/02/base.json +24 -0
- package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/02/merged.json +39 -0
- package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/02/metadata.json +5 -0
- package/test-fixtures/reducers/copy/04 - compareWithoutIndicators/02/source.json +24 -0
- package/test-fixtures/reducers/copy/05 - copyUnless/01/base.json +9 -0
- package/test-fixtures/reducers/copy/05 - copyUnless/01/merged.json +24 -0
- package/test-fixtures/reducers/copy/05 - copyUnless/01/metadata.json +5 -0
- package/test-fixtures/reducers/copy/05 - copyUnless/01/source.json +47 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/01/base.json +24 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/01/merged.json +39 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/01/metadata.json +5 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/01/source.json +24 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/02/base.json +24 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/02/merged.json +24 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/02/metadata.json +5 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/02/source.json +24 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/03/base.json +28 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/03/merged.json +43 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/03/metadata.json +5 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/03/source.json +24 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/04/base.json +28 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/04/merged.json +28 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/04/metadata.json +5 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/04/source.json +24 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/05/base.json +20 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/05/merged.json +35 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/05/metadata.json +5 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/05/source.json +24 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/06/base.json +20 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/06/merged.json +35 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/06/metadata.json +5 -0
- package/test-fixtures/reducers/copy/06 - subfieldsMustBeIdentical/06/source.json +24 -0
- package/test-fixtures/reducers/copy/{07 → 07 - excludeSubfields/01}/base.json +0 -0
- package/test-fixtures/reducers/copy/{07 → 07 - excludeSubfields/01}/merged.json +0 -0
- package/test-fixtures/reducers/copy/07 - excludeSubfields/01/metadata.json +8 -0
- package/test-fixtures/reducers/copy/{07 → 07 - excludeSubfields/01}/source.json +0 -0
- package/test-fixtures/reducers/copy/07 - excludeSubfields/02/base.json +39 -0
- package/test-fixtures/reducers/copy/07 - excludeSubfields/02/merged.json +58 -0
- package/test-fixtures/reducers/copy/07 - excludeSubfields/02/metadata.json +5 -0
- package/test-fixtures/reducers/copy/07 - excludeSubfields/02/source.json +43 -0
- package/test-fixtures/reducers/copy/{08 → 08 - dropSubfields/01}/base.json +0 -0
- package/test-fixtures/reducers/copy/{08/merged.json → 08 - dropSubfields/01/merged.json } +8 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/01/metadata.json +5 -0
- package/test-fixtures/reducers/copy/{08 → 08 - dropSubfields/01}/source.json +0 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/02/base.json +43 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/02/merged.json +58 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/02/metadata.json +5 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/02/source.json +32 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/03/base.json +43 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/03/merged.json +58 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/03/metadata.json +5 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/03/source.json +32 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/04/base.json +43 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/04/merged.json +43 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/04/metadata.json +5 -0
- package/test-fixtures/reducers/copy/08 - dropSubfields/04/source.json +32 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/base.json +9 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/merged.json +20 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/metadata.json +6 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/01/source.json +20 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/base.json +9 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/merged.json +20 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/metadata.json +6 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/02/source.json +20 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/base.json +9 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/merged.json +31 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/metadata.json +6 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/03/source.json +31 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/base.json +9 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/merged.json +42 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/metadata.json +6 -0
- package/test-fixtures/reducers/copy/09 - swapSubfieldCode/04/source.json +42 -0
- package/test-fixtures/reducers/copy/10 - swapTag/01/base.json +17 -0
- package/test-fixtures/reducers/copy/10 - swapTag/01/merged.json +28 -0
- package/test-fixtures/reducers/copy/10 - swapTag/01/metadata.json +6 -0
- package/test-fixtures/reducers/copy/10 - swapTag/01/source.json +20 -0
- package/test-fixtures/reducers/metadata.json +4 -0
- package/test-fixtures/reducers/select/01/metadata.json +5 -0
- package/test-fixtures/reducers/select/02/metadata.json +4 -0
- package/test-fixtures/reducers/select/03/metadata.json +4 -0
- package/test-fixtures/reducers/select/04/metadata.json +5 -0
- package/test-fixtures/reducers/select/05/metadata.json +4 -0
- package/test-fixtures/reducers/select/06/metadata.json +4 -0
- package/test-fixtures/reducers/select/07/metadata.json +5 -0
- package/test-fixtures/reducers/select/08/metadata.json +4 -0
- package/test-fixtures/reducers/select/09/metadata.json +4 -0
- package/test-fixtures/reducers/select/10/metadata.json +5 -0
- package/test-fixtures/reducers/select/11/metadata.json +4 -0
- package/test-fixtures/reducers/select/12/metadata.json +5 -0
- package/test-fixtures/reducers/select/13/metadata.json +4 -0
- package/test-fixtures/reducers/select/14/metadata.json +4 -0
- package/.drone.yml +0 -92
- package/.nyc_output/72717fff-b4ac-4aef-a145-37cae88e07f8.json +0 -1
- package/.nyc_output/processinfo/72717fff-b4ac-4aef-a145-37cae88e07f8.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/LICENSE.txt +0 -165
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -79
- package/coverage/copy.js.html +0 -500
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -126
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -79
- package/coverage/lcov-report/copy.js.html +0 -500
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -126
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/select.js.html +0 -539
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -170
- package/coverage/lcov.info +0 -274
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/select.js.html +0 -539
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -170
- package/test-fixtures/reducers/copy/01/tagPattern.txt +0 -1
- package/test-fixtures/reducers/copy/02/tagPattern.txt +0 -1
- package/test-fixtures/reducers/copy/03/tagPattern.txt +0 -1
- package/test-fixtures/reducers/copy/04/tagPattern.txt +0 -1
- package/test-fixtures/reducers/copy/05/tagPattern.txt +0 -1
- package/test-fixtures/reducers/copy/06/compareTagsOnly.txt +0 -1
- package/test-fixtures/reducers/copy/06/tagPattern.txt +0 -1
- package/test-fixtures/reducers/copy/07/excludeSubfields.json +0 -1
- package/test-fixtures/reducers/copy/07/tagPattern.txt +0 -1
- package/test-fixtures/reducers/copy/08/dropSubfields.json +0 -1
- package/test-fixtures/reducers/copy/08/tagPattern.txt +0 -1
- package/test-fixtures/reducers/copy/09/compareTagsOnly.txt +0 -1
- package/test-fixtures/reducers/copy/09/tagPattern.txt +0 -1
- package/test-fixtures/reducers/select/01/expected-error.txt +0 -1
- package/test-fixtures/reducers/select/01/pattern.txt +0 -1
- package/test-fixtures/reducers/select/02/pattern.txt +0 -1
- package/test-fixtures/reducers/select/03/pattern.txt +0 -1
- package/test-fixtures/reducers/select/04/pattern.txt +0 -1
- package/test-fixtures/reducers/select/05/pattern.txt +0 -1
- package/test-fixtures/reducers/select/06/pattern.txt +0 -1
- package/test-fixtures/reducers/select/07/equalityFunction.txt +0 -1
- package/test-fixtures/reducers/select/07/pattern.txt +0 -1
- package/test-fixtures/reducers/select/08/pattern.txt +0 -1
- package/test-fixtures/reducers/select/09/pattern.txt +0 -1
- package/test-fixtures/reducers/select/10/equalityFunction.txt +0 -1
- package/test-fixtures/reducers/select/10/pattern.txt +0 -1
- package/test-fixtures/reducers/select/11/pattern.txt +0 -1
- package/test-fixtures/reducers/select/12/equalityFunction.txt +0 -1
- package/test-fixtures/reducers/select/12/pattern.txt +0 -1
- package/test-fixtures/reducers/select/13/pattern.txt +0 -1
- package/test-fixtures/reducers/select/14/pattern.txt +0 -1
package/coverage/copy.js.html
DELETED
|
@@ -1,500 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Code coverage report for copy.js</title>
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="prettify.css" />
|
|
9
|
-
<link rel="stylesheet" href="base.css" />
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
-
<style type='text/css'>
|
|
13
|
-
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(sort-arrow-sprite.png);
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class='wrapper'>
|
|
21
|
-
<div class='pad1'>
|
|
22
|
-
<h1><a href="index.html">All files</a> copy.js</h1>
|
|
23
|
-
<div class='clearfix'>
|
|
24
|
-
|
|
25
|
-
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">100% </span>
|
|
27
|
-
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>62/62</span>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">93.1% </span>
|
|
34
|
-
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>27/29</span>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">100% </span>
|
|
41
|
-
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>23/23</span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">100% </span>
|
|
48
|
-
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>50/50</span>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<p class="quiet">
|
|
55
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
-
</p>
|
|
57
|
-
</div>
|
|
58
|
-
<div class='status-line high'></div>
|
|
59
|
-
<pre><table class="coverage">
|
|
60
|
-
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
61
|
-
<a name='L2'></a><a href='#L2'>2</a>
|
|
62
|
-
<a name='L3'></a><a href='#L3'>3</a>
|
|
63
|
-
<a name='L4'></a><a href='#L4'>4</a>
|
|
64
|
-
<a name='L5'></a><a href='#L5'>5</a>
|
|
65
|
-
<a name='L6'></a><a href='#L6'>6</a>
|
|
66
|
-
<a name='L7'></a><a href='#L7'>7</a>
|
|
67
|
-
<a name='L8'></a><a href='#L8'>8</a>
|
|
68
|
-
<a name='L9'></a><a href='#L9'>9</a>
|
|
69
|
-
<a name='L10'></a><a href='#L10'>10</a>
|
|
70
|
-
<a name='L11'></a><a href='#L11'>11</a>
|
|
71
|
-
<a name='L12'></a><a href='#L12'>12</a>
|
|
72
|
-
<a name='L13'></a><a href='#L13'>13</a>
|
|
73
|
-
<a name='L14'></a><a href='#L14'>14</a>
|
|
74
|
-
<a name='L15'></a><a href='#L15'>15</a>
|
|
75
|
-
<a name='L16'></a><a href='#L16'>16</a>
|
|
76
|
-
<a name='L17'></a><a href='#L17'>17</a>
|
|
77
|
-
<a name='L18'></a><a href='#L18'>18</a>
|
|
78
|
-
<a name='L19'></a><a href='#L19'>19</a>
|
|
79
|
-
<a name='L20'></a><a href='#L20'>20</a>
|
|
80
|
-
<a name='L21'></a><a href='#L21'>21</a>
|
|
81
|
-
<a name='L22'></a><a href='#L22'>22</a>
|
|
82
|
-
<a name='L23'></a><a href='#L23'>23</a>
|
|
83
|
-
<a name='L24'></a><a href='#L24'>24</a>
|
|
84
|
-
<a name='L25'></a><a href='#L25'>25</a>
|
|
85
|
-
<a name='L26'></a><a href='#L26'>26</a>
|
|
86
|
-
<a name='L27'></a><a href='#L27'>27</a>
|
|
87
|
-
<a name='L28'></a><a href='#L28'>28</a>
|
|
88
|
-
<a name='L29'></a><a href='#L29'>29</a>
|
|
89
|
-
<a name='L30'></a><a href='#L30'>30</a>
|
|
90
|
-
<a name='L31'></a><a href='#L31'>31</a>
|
|
91
|
-
<a name='L32'></a><a href='#L32'>32</a>
|
|
92
|
-
<a name='L33'></a><a href='#L33'>33</a>
|
|
93
|
-
<a name='L34'></a><a href='#L34'>34</a>
|
|
94
|
-
<a name='L35'></a><a href='#L35'>35</a>
|
|
95
|
-
<a name='L36'></a><a href='#L36'>36</a>
|
|
96
|
-
<a name='L37'></a><a href='#L37'>37</a>
|
|
97
|
-
<a name='L38'></a><a href='#L38'>38</a>
|
|
98
|
-
<a name='L39'></a><a href='#L39'>39</a>
|
|
99
|
-
<a name='L40'></a><a href='#L40'>40</a>
|
|
100
|
-
<a name='L41'></a><a href='#L41'>41</a>
|
|
101
|
-
<a name='L42'></a><a href='#L42'>42</a>
|
|
102
|
-
<a name='L43'></a><a href='#L43'>43</a>
|
|
103
|
-
<a name='L44'></a><a href='#L44'>44</a>
|
|
104
|
-
<a name='L45'></a><a href='#L45'>45</a>
|
|
105
|
-
<a name='L46'></a><a href='#L46'>46</a>
|
|
106
|
-
<a name='L47'></a><a href='#L47'>47</a>
|
|
107
|
-
<a name='L48'></a><a href='#L48'>48</a>
|
|
108
|
-
<a name='L49'></a><a href='#L49'>49</a>
|
|
109
|
-
<a name='L50'></a><a href='#L50'>50</a>
|
|
110
|
-
<a name='L51'></a><a href='#L51'>51</a>
|
|
111
|
-
<a name='L52'></a><a href='#L52'>52</a>
|
|
112
|
-
<a name='L53'></a><a href='#L53'>53</a>
|
|
113
|
-
<a name='L54'></a><a href='#L54'>54</a>
|
|
114
|
-
<a name='L55'></a><a href='#L55'>55</a>
|
|
115
|
-
<a name='L56'></a><a href='#L56'>56</a>
|
|
116
|
-
<a name='L57'></a><a href='#L57'>57</a>
|
|
117
|
-
<a name='L58'></a><a href='#L58'>58</a>
|
|
118
|
-
<a name='L59'></a><a href='#L59'>59</a>
|
|
119
|
-
<a name='L60'></a><a href='#L60'>60</a>
|
|
120
|
-
<a name='L61'></a><a href='#L61'>61</a>
|
|
121
|
-
<a name='L62'></a><a href='#L62'>62</a>
|
|
122
|
-
<a name='L63'></a><a href='#L63'>63</a>
|
|
123
|
-
<a name='L64'></a><a href='#L64'>64</a>
|
|
124
|
-
<a name='L65'></a><a href='#L65'>65</a>
|
|
125
|
-
<a name='L66'></a><a href='#L66'>66</a>
|
|
126
|
-
<a name='L67'></a><a href='#L67'>67</a>
|
|
127
|
-
<a name='L68'></a><a href='#L68'>68</a>
|
|
128
|
-
<a name='L69'></a><a href='#L69'>69</a>
|
|
129
|
-
<a name='L70'></a><a href='#L70'>70</a>
|
|
130
|
-
<a name='L71'></a><a href='#L71'>71</a>
|
|
131
|
-
<a name='L72'></a><a href='#L72'>72</a>
|
|
132
|
-
<a name='L73'></a><a href='#L73'>73</a>
|
|
133
|
-
<a name='L74'></a><a href='#L74'>74</a>
|
|
134
|
-
<a name='L75'></a><a href='#L75'>75</a>
|
|
135
|
-
<a name='L76'></a><a href='#L76'>76</a>
|
|
136
|
-
<a name='L77'></a><a href='#L77'>77</a>
|
|
137
|
-
<a name='L78'></a><a href='#L78'>78</a>
|
|
138
|
-
<a name='L79'></a><a href='#L79'>79</a>
|
|
139
|
-
<a name='L80'></a><a href='#L80'>80</a>
|
|
140
|
-
<a name='L81'></a><a href='#L81'>81</a>
|
|
141
|
-
<a name='L82'></a><a href='#L82'>82</a>
|
|
142
|
-
<a name='L83'></a><a href='#L83'>83</a>
|
|
143
|
-
<a name='L84'></a><a href='#L84'>84</a>
|
|
144
|
-
<a name='L85'></a><a href='#L85'>85</a>
|
|
145
|
-
<a name='L86'></a><a href='#L86'>86</a>
|
|
146
|
-
<a name='L87'></a><a href='#L87'>87</a>
|
|
147
|
-
<a name='L88'></a><a href='#L88'>88</a>
|
|
148
|
-
<a name='L89'></a><a href='#L89'>89</a>
|
|
149
|
-
<a name='L90'></a><a href='#L90'>90</a>
|
|
150
|
-
<a name='L91'></a><a href='#L91'>91</a>
|
|
151
|
-
<a name='L92'></a><a href='#L92'>92</a>
|
|
152
|
-
<a name='L93'></a><a href='#L93'>93</a>
|
|
153
|
-
<a name='L94'></a><a href='#L94'>94</a>
|
|
154
|
-
<a name='L95'></a><a href='#L95'>95</a>
|
|
155
|
-
<a name='L96'></a><a href='#L96'>96</a>
|
|
156
|
-
<a name='L97'></a><a href='#L97'>97</a>
|
|
157
|
-
<a name='L98'></a><a href='#L98'>98</a>
|
|
158
|
-
<a name='L99'></a><a href='#L99'>99</a>
|
|
159
|
-
<a name='L100'></a><a href='#L100'>100</a>
|
|
160
|
-
<a name='L101'></a><a href='#L101'>101</a>
|
|
161
|
-
<a name='L102'></a><a href='#L102'>102</a>
|
|
162
|
-
<a name='L103'></a><a href='#L103'>103</a>
|
|
163
|
-
<a name='L104'></a><a href='#L104'>104</a>
|
|
164
|
-
<a name='L105'></a><a href='#L105'>105</a>
|
|
165
|
-
<a name='L106'></a><a href='#L106'>106</a>
|
|
166
|
-
<a name='L107'></a><a href='#L107'>107</a>
|
|
167
|
-
<a name='L108'></a><a href='#L108'>108</a>
|
|
168
|
-
<a name='L109'></a><a href='#L109'>109</a>
|
|
169
|
-
<a name='L110'></a><a href='#L110'>110</a>
|
|
170
|
-
<a name='L111'></a><a href='#L111'>111</a>
|
|
171
|
-
<a name='L112'></a><a href='#L112'>112</a>
|
|
172
|
-
<a name='L113'></a><a href='#L113'>113</a>
|
|
173
|
-
<a name='L114'></a><a href='#L114'>114</a>
|
|
174
|
-
<a name='L115'></a><a href='#L115'>115</a>
|
|
175
|
-
<a name='L116'></a><a href='#L116'>116</a>
|
|
176
|
-
<a name='L117'></a><a href='#L117'>117</a>
|
|
177
|
-
<a name='L118'></a><a href='#L118'>118</a>
|
|
178
|
-
<a name='L119'></a><a href='#L119'>119</a>
|
|
179
|
-
<a name='L120'></a><a href='#L120'>120</a>
|
|
180
|
-
<a name='L121'></a><a href='#L121'>121</a>
|
|
181
|
-
<a name='L122'></a><a href='#L122'>122</a>
|
|
182
|
-
<a name='L123'></a><a href='#L123'>123</a>
|
|
183
|
-
<a name='L124'></a><a href='#L124'>124</a>
|
|
184
|
-
<a name='L125'></a><a href='#L125'>125</a>
|
|
185
|
-
<a name='L126'></a><a href='#L126'>126</a>
|
|
186
|
-
<a name='L127'></a><a href='#L127'>127</a>
|
|
187
|
-
<a name='L128'></a><a href='#L128'>128</a>
|
|
188
|
-
<a name='L129'></a><a href='#L129'>129</a>
|
|
189
|
-
<a name='L130'></a><a href='#L130'>130</a>
|
|
190
|
-
<a name='L131'></a><a href='#L131'>131</a>
|
|
191
|
-
<a name='L132'></a><a href='#L132'>132</a>
|
|
192
|
-
<a name='L133'></a><a href='#L133'>133</a>
|
|
193
|
-
<a name='L134'></a><a href='#L134'>134</a>
|
|
194
|
-
<a name='L135'></a><a href='#L135'>135</a>
|
|
195
|
-
<a name='L136'></a><a href='#L136'>136</a>
|
|
196
|
-
<a name='L137'></a><a href='#L137'>137</a>
|
|
197
|
-
<a name='L138'></a><a href='#L138'>138</a>
|
|
198
|
-
<a name='L139'></a><a href='#L139'>139</a>
|
|
199
|
-
<a name='L140'></a><a href='#L140'>140</a>
|
|
200
|
-
<a name='L141'></a><a href='#L141'>141</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
201
|
-
<span class="cline-any cline-neutral"> </span>
|
|
202
|
-
<span class="cline-any cline-neutral"> </span>
|
|
203
|
-
<span class="cline-any cline-neutral"> </span>
|
|
204
|
-
<span class="cline-any cline-neutral"> </span>
|
|
205
|
-
<span class="cline-any cline-neutral"> </span>
|
|
206
|
-
<span class="cline-any cline-neutral"> </span>
|
|
207
|
-
<span class="cline-any cline-neutral"> </span>
|
|
208
|
-
<span class="cline-any cline-neutral"> </span>
|
|
209
|
-
<span class="cline-any cline-neutral"> </span>
|
|
210
|
-
<span class="cline-any cline-neutral"> </span>
|
|
211
|
-
<span class="cline-any cline-neutral"> </span>
|
|
212
|
-
<span class="cline-any cline-neutral"> </span>
|
|
213
|
-
<span class="cline-any cline-neutral"> </span>
|
|
214
|
-
<span class="cline-any cline-neutral"> </span>
|
|
215
|
-
<span class="cline-any cline-neutral"> </span>
|
|
216
|
-
<span class="cline-any cline-neutral"> </span>
|
|
217
|
-
<span class="cline-any cline-neutral"> </span>
|
|
218
|
-
<span class="cline-any cline-neutral"> </span>
|
|
219
|
-
<span class="cline-any cline-neutral"> </span>
|
|
220
|
-
<span class="cline-any cline-neutral"> </span>
|
|
221
|
-
<span class="cline-any cline-neutral"> </span>
|
|
222
|
-
<span class="cline-any cline-neutral"> </span>
|
|
223
|
-
<span class="cline-any cline-neutral"> </span>
|
|
224
|
-
<span class="cline-any cline-neutral"> </span>
|
|
225
|
-
<span class="cline-any cline-neutral"> </span>
|
|
226
|
-
<span class="cline-any cline-neutral"> </span>
|
|
227
|
-
<span class="cline-any cline-neutral"> </span>
|
|
228
|
-
<span class="cline-any cline-neutral"> </span>
|
|
229
|
-
<span class="cline-any cline-neutral"> </span>
|
|
230
|
-
<span class="cline-any cline-neutral"> </span>
|
|
231
|
-
<span class="cline-any cline-neutral"> </span>
|
|
232
|
-
<span class="cline-any cline-neutral"> </span>
|
|
233
|
-
<span class="cline-any cline-neutral"> </span>
|
|
234
|
-
<span class="cline-any cline-neutral"> </span>
|
|
235
|
-
<span class="cline-any cline-neutral"> </span>
|
|
236
|
-
<span class="cline-any cline-neutral"> </span>
|
|
237
|
-
<span class="cline-any cline-neutral"> </span>
|
|
238
|
-
<span class="cline-any cline-neutral"> </span>
|
|
239
|
-
<span class="cline-any cline-neutral"> </span>
|
|
240
|
-
<span class="cline-any cline-neutral"> </span>
|
|
241
|
-
<span class="cline-any cline-yes">9x</span>
|
|
242
|
-
<span class="cline-any cline-yes">9x</span>
|
|
243
|
-
<span class="cline-any cline-yes">9x</span>
|
|
244
|
-
<span class="cline-any cline-neutral"> </span>
|
|
245
|
-
<span class="cline-any cline-yes">9x</span>
|
|
246
|
-
<span class="cline-any cline-yes">9x</span>
|
|
247
|
-
<span class="cline-any cline-neutral"> </span>
|
|
248
|
-
<span class="cline-any cline-neutral"> </span>
|
|
249
|
-
<span class="cline-any cline-yes">18x</span>
|
|
250
|
-
<span class="cline-any cline-yes">18x</span>
|
|
251
|
-
<span class="cline-any cline-neutral"> </span>
|
|
252
|
-
<span class="cline-any cline-neutral"> </span>
|
|
253
|
-
<span class="cline-any cline-neutral"> </span>
|
|
254
|
-
<span class="cline-any cline-yes">9x</span>
|
|
255
|
-
<span class="cline-any cline-yes">5x</span>
|
|
256
|
-
<span class="cline-any cline-yes">5x</span>
|
|
257
|
-
<span class="cline-any cline-yes">2x</span>
|
|
258
|
-
<span class="cline-any cline-neutral"> </span>
|
|
259
|
-
<span class="cline-any cline-neutral"> </span>
|
|
260
|
-
<span class="cline-any cline-neutral"> </span>
|
|
261
|
-
<span class="cline-any cline-neutral"> </span>
|
|
262
|
-
<span class="cline-any cline-neutral"> </span>
|
|
263
|
-
<span class="cline-any cline-yes">7x</span>
|
|
264
|
-
<span class="cline-any cline-yes">6x</span>
|
|
265
|
-
<span class="cline-any cline-yes">12x</span>
|
|
266
|
-
<span class="cline-any cline-yes">3x</span>
|
|
267
|
-
<span class="cline-any cline-yes">3x</span>
|
|
268
|
-
<span class="cline-any cline-neutral"> </span>
|
|
269
|
-
<span class="cline-any cline-yes">9x</span>
|
|
270
|
-
<span class="cline-any cline-yes">9x</span>
|
|
271
|
-
<span class="cline-any cline-yes">9x</span>
|
|
272
|
-
<span class="cline-any cline-neutral"> </span>
|
|
273
|
-
<span class="cline-any cline-neutral"> </span>
|
|
274
|
-
<span class="cline-any cline-neutral"> </span>
|
|
275
|
-
<span class="cline-any cline-yes">6x</span>
|
|
276
|
-
<span class="cline-any cline-neutral"> </span>
|
|
277
|
-
<span class="cline-any cline-neutral"> </span>
|
|
278
|
-
<span class="cline-any cline-neutral"> </span>
|
|
279
|
-
<span class="cline-any cline-yes">3x</span>
|
|
280
|
-
<span class="cline-any cline-yes">3x</span>
|
|
281
|
-
<span class="cline-any cline-yes">3x</span>
|
|
282
|
-
<span class="cline-any cline-neutral"> </span>
|
|
283
|
-
<span class="cline-any cline-neutral"> </span>
|
|
284
|
-
<span class="cline-any cline-neutral"> </span>
|
|
285
|
-
<span class="cline-any cline-neutral"> </span>
|
|
286
|
-
<span class="cline-any cline-yes">14x</span>
|
|
287
|
-
<span class="cline-any cline-neutral"> </span>
|
|
288
|
-
<span class="cline-any cline-neutral"> </span>
|
|
289
|
-
<span class="cline-any cline-neutral"> </span>
|
|
290
|
-
<span class="cline-any cline-yes">6x</span>
|
|
291
|
-
<span class="cline-any cline-neutral"> </span>
|
|
292
|
-
<span class="cline-any cline-yes">6x</span>
|
|
293
|
-
<span class="cline-any cline-yes">3x</span>
|
|
294
|
-
<span class="cline-any cline-neutral"> </span>
|
|
295
|
-
<span class="cline-any cline-neutral"> </span>
|
|
296
|
-
<span class="cline-any cline-yes">11x</span>
|
|
297
|
-
<span class="cline-any cline-neutral"> </span>
|
|
298
|
-
<span class="cline-any cline-neutral"> </span>
|
|
299
|
-
<span class="cline-any cline-neutral"> </span>
|
|
300
|
-
<span class="cline-any cline-yes">6x</span>
|
|
301
|
-
<span class="cline-any cline-neutral"> </span>
|
|
302
|
-
<span class="cline-any cline-neutral"> </span>
|
|
303
|
-
<span class="cline-any cline-yes">38x</span>
|
|
304
|
-
<span class="cline-any cline-neutral"> </span>
|
|
305
|
-
<span class="cline-any cline-neutral"> </span>
|
|
306
|
-
<span class="cline-any cline-yes">14x</span>
|
|
307
|
-
<span class="cline-any cline-yes">14x</span>
|
|
308
|
-
<span class="cline-any cline-yes">24x</span>
|
|
309
|
-
<span class="cline-any cline-yes">24x</span>
|
|
310
|
-
<span class="cline-any cline-neutral"> </span>
|
|
311
|
-
<span class="cline-any cline-neutral"> </span>
|
|
312
|
-
<span class="cline-any cline-neutral"> </span>
|
|
313
|
-
<span class="cline-any cline-neutral"> </span>
|
|
314
|
-
<span class="cline-any cline-neutral"> </span>
|
|
315
|
-
<span class="cline-any cline-yes">6x</span>
|
|
316
|
-
<span class="cline-any cline-yes">6x</span>
|
|
317
|
-
<span class="cline-any cline-yes">6x</span>
|
|
318
|
-
<span class="cline-any cline-yes">5x</span>
|
|
319
|
-
<span class="cline-any cline-yes">5x</span>
|
|
320
|
-
<span class="cline-any cline-yes">3x</span>
|
|
321
|
-
<span class="cline-any cline-neutral"> </span>
|
|
322
|
-
<span class="cline-any cline-yes">3x</span>
|
|
323
|
-
<span class="cline-any cline-yes">3x</span>
|
|
324
|
-
<span class="cline-any cline-yes">3x</span>
|
|
325
|
-
<span class="cline-any cline-neutral"> </span>
|
|
326
|
-
<span class="cline-any cline-neutral"> </span>
|
|
327
|
-
<span class="cline-any cline-yes">1x</span>
|
|
328
|
-
<span class="cline-any cline-yes">1x</span>
|
|
329
|
-
<span class="cline-any cline-neutral"> </span>
|
|
330
|
-
<span class="cline-any cline-neutral"> </span>
|
|
331
|
-
<span class="cline-any cline-neutral"> </span>
|
|
332
|
-
<span class="cline-any cline-yes">9x</span>
|
|
333
|
-
<span class="cline-any cline-yes">2x</span>
|
|
334
|
-
<span class="cline-any cline-yes">5x</span>
|
|
335
|
-
<span class="cline-any cline-neutral"> </span>
|
|
336
|
-
<span class="cline-any cline-yes">8x</span>
|
|
337
|
-
<span class="cline-any cline-yes">8x</span>
|
|
338
|
-
<span class="cline-any cline-neutral"> </span>
|
|
339
|
-
<span class="cline-any cline-neutral"> </span>
|
|
340
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/**
|
|
341
|
-
*
|
|
342
|
-
* @licstart The following is the entire license notice for the JavaScript code in this file.
|
|
343
|
-
*
|
|
344
|
-
* Merge MARC records
|
|
345
|
-
*
|
|
346
|
-
* Copyright (C) 2015-2019 University Of Helsinki (The National Library Of Finland)
|
|
347
|
-
*
|
|
348
|
-
* This file is part of marc-record-merge-js
|
|
349
|
-
|
|
350
|
-
* marc-record-merge-js program is free software: you can redistribute it and/or modify
|
|
351
|
-
* it under the terms of the GNU Lesser General Public License as
|
|
352
|
-
* published by the Free Software Foundation, either version 3 of the
|
|
353
|
-
* License, or (at your option) any later version.
|
|
354
|
-
*
|
|
355
|
-
* marc-record-merge-js is distributed in the hope that it will be useful,
|
|
356
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
357
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
358
|
-
* GNU Lesser General Public License for more details.
|
|
359
|
-
*
|
|
360
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
361
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
362
|
-
*
|
|
363
|
-
* @licend The above is the entire license notice
|
|
364
|
-
* for the JavaScript code in this file.
|
|
365
|
-
*
|
|
366
|
-
*/
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Test 01: If base does not contain the field at all, it is copied from source to base
|
|
370
|
-
* Test 02: Identical control fields are not copied
|
|
371
|
-
* Test 03: Add missing control field to base
|
|
372
|
-
* Test 04: Identical data fields in base and source, not copied
|
|
373
|
-
* Test 05: Different data fields are copied from source to base (multiple fields)
|
|
374
|
-
* Test 06: compareTagsOnly: Field is copied from source only if it is missing in base, a different instance is not copied
|
|
375
|
-
* Test 07: excludeSubfields: Ignore excluded subfields in comparing identicalness
|
|
376
|
-
* Test 08: dropSubfields: Drop subfields from source before copying
|
|
377
|
-
* Test 09: compareTagsOnly for repeatable fields, 2x each 260/264
|
|
378
|
-
* */
|
|
379
|
-
import createDebugLogger from 'debug';
|
|
380
|
-
|
|
381
|
-
export default ({tagPattern, compareTagsOnly = false, excludeSubfields = [], dropSubfields = []}) => (base, source) => {
|
|
382
|
-
const debug = createDebugLogger('@natlibfi/marc-record-merge');
|
|
383
|
-
const baseFields = base.get(tagPattern);
|
|
384
|
-
// Check whether there are subfields to drop from source before copying
|
|
385
|
-
const sourceFields = checkDropSubfields(source.get(tagPattern));
|
|
386
|
-
return copyFields();
|
|
387
|
-
|
|
388
|
-
function copyFields() {
|
|
389
|
-
const sourceTags = sourceFields.map(field => field.tag);
|
|
390
|
-
sourceTags.forEach(tag => debug(`Comparing field ${tag}`));
|
|
391
|
-
|
|
392
|
-
// If compareTagsOnly = true, only this part is run
|
|
393
|
-
// The field is copied from source only if it is missing completely from base
|
|
394
|
-
if (baseFields.length === 0) {
|
|
395
|
-
sourceTags.forEach(tag => debug(`Missing field ${tag} copied from source to base`));
|
|
396
|
-
sourceFields.forEach(f => base.insertField(f));
|
|
397
|
-
return base;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// If compareTagsOnly = false (default)
|
|
401
|
-
// Source and base are also compared for identicalness
|
|
402
|
-
// Non-identical fields are copied from source to base as duplicates
|
|
403
|
-
if (!compareTagsOnly) {
|
|
404
|
-
const filterMissing = function(sourceField) {
|
|
405
|
-
if ('value' in sourceField) {
|
|
406
|
-
debug(`Checking control field ${sourceField.tag} for identicalness`);
|
|
407
|
-
return baseFields.some(isIdenticalControlField) === false;
|
|
408
|
-
}
|
|
409
|
-
<span class="missing-if-branch" title="else path not taken" >E</span>if ('subfields' in sourceField) {
|
|
410
|
-
debug(`Checking data field ${sourceField.tag} for identicalness`);
|
|
411
|
-
return baseFields.some(isIdenticalDataField) === false;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
function normalizeControlField(field) {
|
|
415
|
-
return field.value.toLowerCase().replace(/\s+/u, '');
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
function isIdenticalControlField(baseField) {
|
|
419
|
-
const normalizedBaseField = normalizeControlField(baseField);
|
|
420
|
-
const normalizedSourceField = normalizeControlField(sourceField);
|
|
421
|
-
return normalizedSourceField === normalizedBaseField;
|
|
422
|
-
}
|
|
423
|
-
function isIdenticalDataField(baseField) {
|
|
424
|
-
// If excluded subfields have been defined for this field, they must be ignored first
|
|
425
|
-
// (i.e. source and base fields are considered identical if all non-excluded subfields are identical)
|
|
426
|
-
if (excludeSubfields.length > 0 &&
|
|
427
|
-
sourceField.tag === baseField.tag &&
|
|
428
|
-
sourceField.ind1 === baseField.ind1 &&
|
|
429
|
-
sourceField.ind2 === baseField.ind2) {
|
|
430
|
-
excludeSubfields.forEach(sub => debug(`Subfield ${sub} excluded from identicalness comparison`));
|
|
431
|
-
// Compare only those subfields that are not excluded
|
|
432
|
-
const baseSubsToCompare = baseField.subfields.filter(subfield => excludeSubfields.indexOf(subfield.code) === -1);
|
|
433
|
-
return baseSubsToCompare.every(isIdenticalSubfield);
|
|
434
|
-
}
|
|
435
|
-
// If there are no excluded subfields (default case)
|
|
436
|
-
if (sourceField.tag === baseField.tag &&
|
|
437
|
-
sourceField.ind1 === baseField.ind1 &&
|
|
438
|
-
sourceField.ind2 === baseField.ind2 &&
|
|
439
|
-
sourceField.subfields.length === baseField.subfields.length) {
|
|
440
|
-
return baseField.subfields.every(isIdenticalSubfield);
|
|
441
|
-
}
|
|
442
|
-
function normalizeSubfield(subfield) {
|
|
443
|
-
return subfield.value.toLowerCase().replace(/\s+/u, '');
|
|
444
|
-
}
|
|
445
|
-
function isIdenticalSubfield(baseSub) {
|
|
446
|
-
const normBaseSub = normalizeSubfield(baseSub);
|
|
447
|
-
return sourceField.subfields.some(sourceSub => {
|
|
448
|
-
const normSourceSub = normalizeSubfield(sourceSub);
|
|
449
|
-
return normSourceSub === normBaseSub;
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
// Search for fields missing from base
|
|
455
|
-
const missingFields = sourceFields.filter(filterMissing);
|
|
456
|
-
missingFields.forEach(f => base.insertField(f));
|
|
457
|
-
if (missingFields.length > 0) {
|
|
458
|
-
const missingTags = missingFields.map(field => field.tag);
|
|
459
|
-
missingTags.forEach(tag => debug(`Field ${tag} copied from source to base`));
|
|
460
|
-
return base;
|
|
461
|
-
}
|
|
462
|
-
<span class="missing-if-branch" title="else path not taken" >E</span>if (missingFields.length === 0) {
|
|
463
|
-
debug(`No missing fields found`);
|
|
464
|
-
return base;
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
debug(`No missing fields found`);
|
|
468
|
-
return base;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
function checkDropSubfields(fields) {
|
|
472
|
-
if (dropSubfields.length > 0) {
|
|
473
|
-
dropSubfields.forEach(sub => debug(`Subfield ${sub} dropped from source field before copying`));
|
|
474
|
-
return fields.map((field) => ({...field, subfields: field.subfields.filter((subfield) => dropSubfields.indexOf(subfield.code) === -1)}));
|
|
475
|
-
}
|
|
476
|
-
debug(`No subfields to drop`);
|
|
477
|
-
return fields;
|
|
478
|
-
}
|
|
479
|
-
};
|
|
480
|
-
</pre></td></tr></table></pre>
|
|
481
|
-
|
|
482
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
483
|
-
</div><!-- /wrapper -->
|
|
484
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
485
|
-
Code coverage generated by
|
|
486
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
487
|
-
at Thu Jun 17 2021 11:16:46 GMT+0000 (Coordinated Universal Time)
|
|
488
|
-
</div>
|
|
489
|
-
</div>
|
|
490
|
-
<script src="prettify.js"></script>
|
|
491
|
-
<script>
|
|
492
|
-
window.onload = function () {
|
|
493
|
-
prettyPrint();
|
|
494
|
-
};
|
|
495
|
-
</script>
|
|
496
|
-
<script src="sorter.js"></script>
|
|
497
|
-
<script src="block-navigation.js"></script>
|
|
498
|
-
</body>
|
|
499
|
-
</html>
|
|
500
|
-
|
package/coverage/favicon.png
DELETED
|
Binary file
|
package/coverage/index.html
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Code coverage report for All files</title>
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="prettify.css" />
|
|
9
|
-
<link rel="stylesheet" href="base.css" />
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
-
<style type='text/css'>
|
|
13
|
-
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(sort-arrow-sprite.png);
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class='wrapper'>
|
|
21
|
-
<div class='pad1'>
|
|
22
|
-
<h1>All files</h1>
|
|
23
|
-
<div class='clearfix'>
|
|
24
|
-
|
|
25
|
-
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">99.21% </span>
|
|
27
|
-
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>126/127</span>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">94.74% </span>
|
|
34
|
-
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>54/57</span>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">100% </span>
|
|
41
|
-
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>43/43</span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">99.12% </span>
|
|
48
|
-
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>112/113</span>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<p class="quiet">
|
|
55
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
-
</p>
|
|
57
|
-
</div>
|
|
58
|
-
<div class='status-line high'></div>
|
|
59
|
-
<div class="pad1">
|
|
60
|
-
<table class="coverage-summary">
|
|
61
|
-
<thead>
|
|
62
|
-
<tr>
|
|
63
|
-
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
64
|
-
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
65
|
-
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
66
|
-
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
67
|
-
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
68
|
-
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
69
|
-
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
70
|
-
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
71
|
-
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
72
|
-
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
73
|
-
</tr>
|
|
74
|
-
</thead>
|
|
75
|
-
<tbody><tr>
|
|
76
|
-
<td class="file high" data-value="copy.js"><a href="copy.js.html">copy.js</a></td>
|
|
77
|
-
<td data-value="100" class="pic high">
|
|
78
|
-
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
79
|
-
</td>
|
|
80
|
-
<td data-value="100" class="pct high">100%</td>
|
|
81
|
-
<td data-value="62" class="abs high">62/62</td>
|
|
82
|
-
<td data-value="93.1" class="pct high">93.1%</td>
|
|
83
|
-
<td data-value="29" class="abs high">27/29</td>
|
|
84
|
-
<td data-value="100" class="pct high">100%</td>
|
|
85
|
-
<td data-value="23" class="abs high">23/23</td>
|
|
86
|
-
<td data-value="100" class="pct high">100%</td>
|
|
87
|
-
<td data-value="50" class="abs high">50/50</td>
|
|
88
|
-
</tr>
|
|
89
|
-
|
|
90
|
-
<tr>
|
|
91
|
-
<td class="file high" data-value="select.js"><a href="select.js.html">select.js</a></td>
|
|
92
|
-
<td data-value="98.46" class="pic high">
|
|
93
|
-
<div class="chart"><div class="cover-fill" style="width: 98%"></div><div class="cover-empty" style="width: 2%"></div></div>
|
|
94
|
-
</td>
|
|
95
|
-
<td data-value="98.46" class="pct high">98.46%</td>
|
|
96
|
-
<td data-value="65" class="abs high">64/65</td>
|
|
97
|
-
<td data-value="96.43" class="pct high">96.43%</td>
|
|
98
|
-
<td data-value="28" class="abs high">27/28</td>
|
|
99
|
-
<td data-value="100" class="pct high">100%</td>
|
|
100
|
-
<td data-value="20" class="abs high">20/20</td>
|
|
101
|
-
<td data-value="98.41" class="pct high">98.41%</td>
|
|
102
|
-
<td data-value="63" class="abs high">62/63</td>
|
|
103
|
-
</tr>
|
|
104
|
-
|
|
105
|
-
</tbody>
|
|
106
|
-
</table>
|
|
107
|
-
</div>
|
|
108
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
109
|
-
</div><!-- /wrapper -->
|
|
110
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
111
|
-
Code coverage generated by
|
|
112
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
113
|
-
at Thu Jun 17 2021 11:16:46 GMT+0000 (Coordinated Universal Time)
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
<script src="prettify.js"></script>
|
|
117
|
-
<script>
|
|
118
|
-
window.onload = function () {
|
|
119
|
-
prettyPrint();
|
|
120
|
-
};
|
|
121
|
-
</script>
|
|
122
|
-
<script src="sorter.js"></script>
|
|
123
|
-
<script src="block-navigation.js"></script>
|
|
124
|
-
</body>
|
|
125
|
-
</html>
|
|
126
|
-
|