isbn3 1.2.1 → 1.2.3
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 +27 -6
- 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
|
@@ -1213,7 +1213,7 @@ module.exports = {
|
|
|
1213
1213
|
'01'
|
|
1214
1214
|
],
|
|
1215
1215
|
[
|
|
1216
|
-
'
|
|
1216
|
+
'320',
|
|
1217
1217
|
'442'
|
|
1218
1218
|
],
|
|
1219
1219
|
[
|
|
@@ -1225,7 +1225,7 @@ module.exports = {
|
|
|
1225
1225
|
'449'
|
|
1226
1226
|
],
|
|
1227
1227
|
[
|
|
1228
|
-
'
|
|
1228
|
+
'5500',
|
|
1229
1229
|
'7793'
|
|
1230
1230
|
],
|
|
1231
1231
|
[
|
|
@@ -1398,6 +1398,27 @@ module.exports = {
|
|
|
1398
1398
|
]
|
|
1399
1399
|
]
|
|
1400
1400
|
},
|
|
1401
|
+
'978-634': {
|
|
1402
|
+
name: 'Indonesia',
|
|
1403
|
+
ranges: [
|
|
1404
|
+
[
|
|
1405
|
+
'00',
|
|
1406
|
+
'04'
|
|
1407
|
+
],
|
|
1408
|
+
[
|
|
1409
|
+
'200',
|
|
1410
|
+
'349'
|
|
1411
|
+
],
|
|
1412
|
+
[
|
|
1413
|
+
'7000',
|
|
1414
|
+
'7999'
|
|
1415
|
+
],
|
|
1416
|
+
[
|
|
1417
|
+
'96000',
|
|
1418
|
+
'99999'
|
|
1419
|
+
]
|
|
1420
|
+
]
|
|
1421
|
+
},
|
|
1401
1422
|
'978-65': {
|
|
1402
1423
|
name: 'Brazil',
|
|
1403
1424
|
ranges: [
|
|
@@ -2519,7 +2540,7 @@ module.exports = {
|
|
|
2519
2540
|
],
|
|
2520
2541
|
[
|
|
2521
2542
|
'649880',
|
|
2522
|
-
'
|
|
2543
|
+
'649899'
|
|
2523
2544
|
],
|
|
2524
2545
|
[
|
|
2525
2546
|
'6499',
|
|
@@ -4234,15 +4255,15 @@ module.exports = {
|
|
|
4234
4255
|
name: 'Cambodia',
|
|
4235
4256
|
ranges: [
|
|
4236
4257
|
[
|
|
4237
|
-
'
|
|
4258
|
+
'28',
|
|
4238
4259
|
'39'
|
|
4239
4260
|
],
|
|
4240
4261
|
[
|
|
4241
4262
|
'500',
|
|
4242
|
-
'
|
|
4263
|
+
'659'
|
|
4243
4264
|
],
|
|
4244
4265
|
[
|
|
4245
|
-
'
|
|
4266
|
+
'8950',
|
|
4246
4267
|
'9999'
|
|
4247
4268
|
]
|
|
4248
4269
|
]
|