@natlibfi/marc-record-validators-melinda 9.0.6 → 9.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.github/CODEOWNERS +10 -0
  2. package/.github/dependabot.yml +40 -0
  3. package/.github/workflows/melinda-node-tests.yml +61 -0
  4. package/LICENSE.txt +21 -165
  5. package/README.md +1 -1
  6. package/dist/access-rights.js +0 -27
  7. package/dist/access-rights.js.map +1 -1
  8. package/dist/access-rights.spec.js +0 -27
  9. package/dist/access-rights.spec.js.map +1 -1
  10. package/dist/double-commas.js +0 -27
  11. package/dist/double-commas.js.map +1 -1
  12. package/dist/double-commas.spec.js +0 -27
  13. package/dist/double-commas.spec.js.map +1 -1
  14. package/dist/duplicates-ind1.js +0 -27
  15. package/dist/duplicates-ind1.js.map +1 -1
  16. package/dist/duplicates-ind1.spec.js +0 -27
  17. package/dist/duplicates-ind1.spec.js.map +1 -1
  18. package/dist/empty-fields.js +0 -28
  19. package/dist/empty-fields.js.map +1 -1
  20. package/dist/empty-fields.spec.js +0 -27
  21. package/dist/empty-fields.spec.js.map +1 -1
  22. package/dist/ending-punctuation-conf.js +0 -28
  23. package/dist/ending-punctuation-conf.js.map +1 -1
  24. package/dist/ending-punctuation.js.map +1 -1
  25. package/dist/ending-punctuation.spec.js +0 -27
  26. package/dist/ending-punctuation.spec.js.map +1 -1
  27. package/dist/field-exclusion.js +0 -28
  28. package/dist/field-exclusion.js.map +1 -1
  29. package/dist/field-exclusion.spec.js +0 -27
  30. package/dist/field-exclusion.spec.js.map +1 -1
  31. package/dist/field-structure.js +0 -28
  32. package/dist/field-structure.js.map +1 -1
  33. package/dist/field-structure.spec.js +0 -27
  34. package/dist/field-structure.spec.js.map +1 -1
  35. package/dist/fields-present.js +0 -27
  36. package/dist/fields-present.js.map +1 -1
  37. package/dist/fields-present.spec.js +0 -27
  38. package/dist/fields-present.spec.js.map +1 -1
  39. package/dist/fixed-fields.js +0 -27
  40. package/dist/fixed-fields.js.map +1 -1
  41. package/dist/fixed-fields.spec.js +0 -27
  42. package/dist/fixed-fields.spec.js.map +1 -1
  43. package/dist/identical-fields.js +0 -28
  44. package/dist/identical-fields.js.map +1 -1
  45. package/dist/identical-fields.spec.js +0 -27
  46. package/dist/identical-fields.spec.js.map +1 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/isbn-issn.js +0 -27
  49. package/dist/isbn-issn.js.map +1 -1
  50. package/dist/isbn-issn.spec.js +0 -27
  51. package/dist/isbn-issn.spec.js.map +1 -1
  52. package/dist/item-language.js +0 -27
  53. package/dist/item-language.js.map +1 -1
  54. package/dist/item-language.spec.js +0 -27
  55. package/dist/item-language.spec.js.map +1 -1
  56. package/dist/punctuation/index.js +21 -1
  57. package/dist/punctuation/index.js.map +1 -1
  58. package/dist/punctuation/rules/aut.js.map +1 -1
  59. package/dist/punctuation/rules/bib.js +8 -1
  60. package/dist/punctuation/rules/bib.js.map +1 -1
  61. package/dist/punctuation/rules/index.js.map +1 -1
  62. package/dist/punctuation.spec.js +49 -140
  63. package/dist/punctuation.spec.js.map +1 -1
  64. package/dist/resolvable-ext-references-melinda.js +0 -27
  65. package/dist/resolvable-ext-references-melinda.js.map +1 -1
  66. package/dist/resolvable-ext-references-melinda.spec.js +3 -29
  67. package/dist/resolvable-ext-references-melinda.spec.js.map +1 -1
  68. package/dist/sort-tags.js +0 -27
  69. package/dist/sort-tags.js.map +1 -1
  70. package/dist/sort-tags.spec.js +0 -27
  71. package/dist/sort-tags.spec.js.map +1 -1
  72. package/dist/subfield-exclusion.js +0 -28
  73. package/dist/subfield-exclusion.js.map +1 -1
  74. package/dist/subfield-exclusion.spec.js +0 -27
  75. package/dist/subfield-exclusion.spec.js.map +1 -1
  76. package/dist/unicode-decomposition.js +0 -28
  77. package/dist/unicode-decomposition.js.map +1 -1
  78. package/dist/unicode-decomposition.spec.js +0 -27
  79. package/dist/unicode-decomposition.spec.js.map +1 -1
  80. package/dist/urn.js +0 -27
  81. package/dist/urn.js.map +1 -1
  82. package/dist/urn.spec.js +0 -27
  83. package/dist/urn.spec.js.map +1 -1
  84. package/package.json +5 -3
  85. package/src/access-rights.js +0 -29
  86. package/src/access-rights.spec.js +0 -29
  87. package/src/double-commas.js +0 -29
  88. package/src/double-commas.spec.js +0 -29
  89. package/src/duplicates-ind1.js +0 -29
  90. package/src/duplicates-ind1.spec.js +0 -29
  91. package/src/empty-fields.js +0 -28
  92. package/src/empty-fields.spec.js +0 -29
  93. package/src/ending-punctuation-conf.js +0 -29
  94. package/src/ending-punctuation.spec.js +0 -29
  95. package/src/field-exclusion.js +0 -29
  96. package/src/field-exclusion.spec.js +0 -29
  97. package/src/field-structure.js +0 -29
  98. package/src/field-structure.spec.js +0 -29
  99. package/src/fields-present.js +0 -29
  100. package/src/fields-present.spec.js +0 -29
  101. package/src/fixed-fields.js +0 -29
  102. package/src/fixed-fields.spec.js +0 -29
  103. package/src/identical-fields.js +0 -28
  104. package/src/identical-fields.spec.js +0 -29
  105. package/src/index.js +0 -29
  106. package/src/isbn-issn.js +0 -28
  107. package/src/isbn-issn.spec.js +0 -29
  108. package/src/item-language.js +0 -29
  109. package/src/item-language.spec.js +0 -29
  110. package/src/punctuation/index.js +19 -1
  111. package/src/punctuation/rules/bib.js +9 -1
  112. package/src/punctuation.spec.js +48 -147
  113. package/src/resolvable-ext-references-melinda.js +0 -28
  114. package/src/resolvable-ext-references-melinda.spec.js +2 -30
  115. package/src/sort-tags.js +0 -29
  116. package/src/sort-tags.spec.js +0 -29
  117. package/src/subfield-exclusion.js +0 -29
  118. package/src/subfield-exclusion.spec.js +0 -29
  119. package/src/unicode-decomposition.js +0 -28
  120. package/src/unicode-decomposition.spec.js +0 -29
  121. package/src/urn.js +0 -29
  122. package/src/urn.spec.js +0 -29
  123. package/test-fixtures/punctuation/01/expectedResult.json +3 -0
  124. package/test-fixtures/punctuation/01/metadata.json +4 -0
  125. package/test-fixtures/punctuation/01/record.json +18 -0
  126. package/test-fixtures/punctuation/02/expectedResult.json +3 -0
  127. package/test-fixtures/punctuation/02/metadata.json +4 -0
  128. package/test-fixtures/punctuation/02/record.json +18 -0
  129. package/test-fixtures/punctuation/03/expectedResult.json +21 -0
  130. package/test-fixtures/punctuation/03/metadata.json +5 -0
  131. package/test-fixtures/punctuation/03/record.json +19 -0
  132. package/test-fixtures/punctuation/04/expectedResult.json +21 -0
  133. package/test-fixtures/punctuation/04/metadata.json +5 -0
  134. package/test-fixtures/punctuation/04/record.json +19 -0
  135. package/test-fixtures/punctuation/05/expectedResult.json +44 -0
  136. package/test-fixtures/punctuation/05/metadata.json +5 -0
  137. package/test-fixtures/punctuation/05/record.json +42 -0
  138. package/test-fixtures/resolvable-ext-references-melinda.js +0 -27
  139. package/.drone.yml +0 -93
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  import chai from 'chai';
31
2
  import chaiAsPromised from 'chai-as-promised';
32
3
  import {MarcRecord} from '@natlibfi/marc-record';
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  // Configuration specification
31
2
  const confSpec = {
32
3
  tag: { // Pattern to match the field's tags
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  import chai from 'chai';
31
2
  import chaiAsPromised from 'chai-as-promised';
32
3
  import {MarcRecord} from '@natlibfi/marc-record';
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  // Configuration specification
31
2
  const confSpec = {
32
3
  leader: { // Description: Leader pattern
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  import chai from 'chai';
31
2
  import chaiAsPromised from 'chai-as-promised';
32
3
  import {MarcRecord} from '@natlibfi/marc-record';
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  export default function (tagPatterns) {
31
2
  if (Array.isArray(tagPatterns)) {
32
3
  return {
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  import chai from 'chai';
31
2
  import chaiAsPromised from 'chai-as-promised';
32
3
  import {MarcRecord} from '@natlibfi/marc-record';
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  export default function (configuration) {
31
2
  if (Array.isArray(configuration)) {
32
3
  return {
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  import chai from 'chai';
31
2
  import chaiAsPromised from 'chai-as-promised';
32
3
  import {MarcRecord} from '@natlibfi/marc-record';
@@ -1,31 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * Melinda-related validators for @natlibfi/marc-record-validate
6
- *
7
- * Copyright (c) 2014-2017 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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
- * This program 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
1
  /**
30
2
  * This validator de-duplicates identical fields in a record.
31
3
  */
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  import {expect} from 'chai';
31
2
  import {MarcRecord} from '@natlibfi/marc-record';
32
3
  import validatorFactory from '../src/identical-fields';
package/src/index.js CHANGED
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  import AccessRights from './access-rights';
31
2
  import DoubleCommas from './double-commas';
32
3
  import DuplicatesInd1 from './duplicates-ind1';
package/src/isbn-issn.js CHANGED
@@ -1,31 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2022 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
1
  import ISBN from 'isbn3';
30
2
  import validateISSN from '@natlibfi/issn-verify';
31
3
 
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2022 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  import {expect} from 'chai';
31
2
  import {MarcRecord} from '@natlibfi/marc-record';
32
3
  import validatorFactory from '../src/isbn-issn';
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  import {loadModule as loadCLD} from 'cld3-asm';
31
2
  import LanguageCodes from 'langs';
32
3
  import createDebugLogger from 'debug';
@@ -1,32 +1,3 @@
1
- /**
2
- *
3
- * @licstart The following is the entire license notice for the JavaScript code in this file.
4
- *
5
- * MARC record validators used in Melinda
6
- *
7
- * Copyright (c) 2014-2020 University Of Helsinki (The National Library Of Finland)
8
- *
9
- * This file is part of marc-record-validators-melinda
10
- *
11
- * marc-record-validators-melinda 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-validators-melinda 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
-
30
1
  import chai from 'chai';
31
2
  import chaiAsPromised from 'chai-as-promised';
32
3
  import {MarcRecord} from '@natlibfi/marc-record';
@@ -86,6 +86,10 @@ export default function () {
86
86
  debug(`Handling subfield ${subfield.code}`);
87
87
  let portion = getPortion(subfield, rulesForField); // eslint-disable-line functional/no-let
88
88
 
89
+ if (portion === false) {
90
+ return;
91
+ }
92
+
89
93
  if (portion === 'CF' || portion === 'NC') {
90
94
  return;
91
95
  }
@@ -140,7 +144,7 @@ export default function () {
140
144
  const [portion] = rules.filter(rule => rule.namePortion === subfield.code).map(rule => rule.portion);
141
145
 
142
146
  if (portion === undefined) {
143
- throw new Error(`Unknown subfield code ${subfield.code}`);
147
+ return false;
144
148
  }
145
149
 
146
150
  return portion.toUpperCase();
@@ -194,6 +198,20 @@ export default function () {
194
198
  }
195
199
  }
196
200
 
201
+ if (punctType === 'SPACECOLON') {
202
+ if (!(/:$/u).test(preceedingSubfield.value)) { // eslint-disable-line functional/no-conditional-statement
203
+ const nextValue = `${preceedingSubfield.value} :`;
204
+ debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
205
+ preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
206
+ }
207
+ if ((/[^ ]:$/u).test(preceedingSubfield.value)) { // eslint-disable-line functional/no-conditional-statement
208
+ const nextValue = `${preceedingSubfield.value.slice(0, -1)} :`;
209
+ debug(`Updated subfield ${preceedingSubfield.code} from '${preceedingSubfield.value}' to '${nextValue}'`);
210
+ preceedingSubfield.value = nextValue; // eslint-disable-line functional/immutable-data
211
+ }
212
+
213
+ }
214
+
197
215
  debug('addSubfieldPunctuation -- end');
198
216
  }
199
217
 
@@ -24,6 +24,14 @@ const bibRules =
24
24
  preceedingPunctuation: 'none',
25
25
  exceptions: ''
26
26
  },
27
+ {
28
+ selector: '264',
29
+ namePortion: '$a',
30
+ description: 'Place of producer, publisher, distributor, manufacturer (R)',
31
+ portion: 'N',
32
+ preceedingPunctuation: 'none',
33
+ exceptions: ''
34
+ },
27
35
  {
28
36
  selector: '[1678]00',
29
37
  namePortion: '$b',
@@ -45,7 +53,7 @@ const bibRules =
45
53
  namePortion: '$b',
46
54
  description: 'Name of producer, publisher, distributor, manufacturer (R)',
47
55
  portion: 'N',
48
- preceedingPunctuation: 'none',
56
+ preceedingPunctuation: 'spacecolon',
49
57
  exceptions: ''
50
58
  },
51
59
  {