isbn3 1.2.0 → 1.2.2
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/bin/isbn-checksum +6 -1
- package/lib/groups.js +26 -5
- package/package.json +1 -1
package/bin/isbn-checksum
CHANGED
|
@@ -8,7 +8,12 @@ else if (normalized.length === 13) normalized = normalized.substring(0, 12)
|
|
|
8
8
|
const calculateCheckDigit = require('../lib/calculate_check_digit')
|
|
9
9
|
const parse = require('../lib/parse')
|
|
10
10
|
const checksum = calculateCheckDigit(normalized)
|
|
11
|
-
const
|
|
11
|
+
const isbnData = parse(`${normalized}${checksum}`)
|
|
12
|
+
if (isbnData == null) {
|
|
13
|
+
process.stderr.write('invalid ISBN despite recalculated checksum\n')
|
|
14
|
+
process.exit(1)
|
|
15
|
+
}
|
|
16
|
+
const { isbn13h } = isbnData
|
|
12
17
|
|
|
13
18
|
if (option === 'c') {
|
|
14
19
|
process.stdout.write(checksum)
|
package/lib/groups.js
CHANGED
|
@@ -1313,7 +1313,7 @@ module.exports = {
|
|
|
1313
1313
|
'02'
|
|
1314
1314
|
],
|
|
1315
1315
|
[
|
|
1316
|
-
'
|
|
1316
|
+
'460',
|
|
1317
1317
|
'499'
|
|
1318
1318
|
],
|
|
1319
1319
|
[
|
|
@@ -1321,7 +1321,7 @@ module.exports = {
|
|
|
1321
1321
|
'7999'
|
|
1322
1322
|
],
|
|
1323
1323
|
[
|
|
1324
|
-
'
|
|
1324
|
+
'95000',
|
|
1325
1325
|
'99999'
|
|
1326
1326
|
]
|
|
1327
1327
|
]
|
|
@@ -1377,6 +1377,27 @@ module.exports = {
|
|
|
1377
1377
|
]
|
|
1378
1378
|
]
|
|
1379
1379
|
},
|
|
1380
|
+
'978-633': {
|
|
1381
|
+
name: 'Egypt',
|
|
1382
|
+
ranges: [
|
|
1383
|
+
[
|
|
1384
|
+
'00',
|
|
1385
|
+
'01'
|
|
1386
|
+
],
|
|
1387
|
+
[
|
|
1388
|
+
'300',
|
|
1389
|
+
'349'
|
|
1390
|
+
],
|
|
1391
|
+
[
|
|
1392
|
+
'8250',
|
|
1393
|
+
'8999'
|
|
1394
|
+
],
|
|
1395
|
+
[
|
|
1396
|
+
'99500',
|
|
1397
|
+
'99999'
|
|
1398
|
+
]
|
|
1399
|
+
]
|
|
1400
|
+
},
|
|
1380
1401
|
'978-65': {
|
|
1381
1402
|
name: 'Brazil',
|
|
1382
1403
|
ranges: [
|
|
@@ -4003,7 +4024,7 @@ module.exports = {
|
|
|
4003
4024
|
name: 'Kenya',
|
|
4004
4025
|
ranges: [
|
|
4005
4026
|
[
|
|
4006
|
-
'
|
|
4027
|
+
'35',
|
|
4007
4028
|
'55'
|
|
4008
4029
|
],
|
|
4009
4030
|
[
|
|
@@ -4011,7 +4032,7 @@ module.exports = {
|
|
|
4011
4032
|
'774'
|
|
4012
4033
|
],
|
|
4013
4034
|
[
|
|
4014
|
-
'
|
|
4035
|
+
'9450',
|
|
4015
4036
|
'9999'
|
|
4016
4037
|
]
|
|
4017
4038
|
]
|
|
@@ -4183,7 +4204,7 @@ module.exports = {
|
|
|
4183
4204
|
'799'
|
|
4184
4205
|
],
|
|
4185
4206
|
[
|
|
4186
|
-
'
|
|
4207
|
+
'8250',
|
|
4187
4208
|
'9999'
|
|
4188
4209
|
]
|
|
4189
4210
|
]
|