isbn3 1.1.32 → 1.1.34

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/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # CHANGELOG
2
+ *versions follow [SemVer](http://semver.org)*
3
+
4
+ ## 1.1.0- 2020-04-24
5
+ * Add [`audit`](https://github.com/inventaire/isbn3#audit) function and corresponding [`isbn-audit`](https://github.com/inventaire/isbn3#isbn-audit) CLI command
6
+ * Add [`isbn-checksum`](https://github.com/inventaire/isbn3#isbn-checksum) CLI command
7
+ * Add dist files `./dist/isbn.js` and `./dist/isbn.min.js`, both being browserified ES5 versions of the module
8
+
9
+ ## 1.0.0 - 2019-10-07
10
+ Fork from [isbn2](https://www.npmjs.com/package/isbn2)
11
+
12
+ **BREAKING CHANGES**
13
+ * accept approximately formatted ISBNs such as '978-4873113364' that would previously have return a `null` result
14
+ * functions are now directly exposed on the module object:
15
+ ```js
16
+ require('isbn2').ISBN.parse('1933988037').codes.isbn13h // => '978-1-933988-03-0'
17
+ // becomes
18
+ require('isbn3').parse('1933988037').isbn13h // => '978-1-933988-03-0'
19
+ ```
20
+
21
+ ** Added features**
22
+ * added a [command-line interface](https://github.com/inventaire/isbn3#CLI)
23
+ * [expose groups data on the module object](https://github.com/inventaire/isbn3#groups)
24
+ * recover common hyphenization mistake `979-1091146135`
package/isbn.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ interface ISBNAudit {
2
+ source: string;
3
+ validIsbn: boolean;
4
+ groupname?: string;
5
+ clues: Array<{
6
+ message: string;
7
+ candidate: string;
8
+ groupname: string;
9
+ }>;
10
+ }
11
+
12
+ interface ISBN {
13
+ source: string;
14
+ isValid: boolean;
15
+ isIsbn10: boolean;
16
+ isIsbn13: boolean;
17
+ prefix?: string;
18
+ group: string;
19
+ publisher: string;
20
+ article: string;
21
+ check: string;
22
+ isbn13?: string;
23
+ isbn13h?: string;
24
+ check10: string;
25
+ check13: string;
26
+ groupname: string;
27
+ isbn10?: string;
28
+ isbn10h?: string;
29
+ }
30
+
31
+ declare module "isbn3" {
32
+ export function parse(isbn: string): ISBN | null;
33
+ export function asIsbn13(isbn: string): string;
34
+ export function asIsbn10(isbn: string): string;
35
+ export function hyphenate(isbn: string): string;
36
+ export function audit(isbn: string): ISBNAudit;
37
+ export const groups: Record<
38
+ string,
39
+ {
40
+ name: string;
41
+ ranges: Array<[string, string]>;
42
+ }
43
+ >;
44
+ }
package/lib/groups.js CHANGED
@@ -667,6 +667,14 @@ module.exports = {
667
667
  ranges: [
668
668
  [
669
669
  '0',
670
+ '2'
671
+ ],
672
+ [
673
+ '300',
674
+ '399'
675
+ ],
676
+ [
677
+ '4',
670
678
  '4'
671
679
  ],
672
680
  [
@@ -1296,7 +1304,7 @@ module.exports = {
1296
1304
  '902449'
1297
1305
  ],
1298
1306
  [
1299
- '990000',
1307
+ '980000',
1300
1308
  '999999'
1301
1309
  ]
1302
1310
  ]
@@ -3256,14 +3264,10 @@ module.exports = {
3256
3264
  ],
3257
3265
  [
3258
3266
  '200',
3259
- '739'
3260
- ],
3261
- [
3262
- '74000',
3263
- '76999'
3267
+ '699'
3264
3268
  ],
3265
3269
  [
3266
- '77000',
3270
+ '70000',
3267
3271
  '79999'
3268
3272
  ],
3269
3273
  [
@@ -3348,14 +3352,14 @@ module.exports = {
3348
3352
  ranges: [
3349
3353
  [
3350
3354
  '00',
3351
- '04'
3355
+ '07'
3352
3356
  ],
3353
3357
  [
3354
3358
  '600',
3355
- '649'
3359
+ '699'
3356
3360
  ],
3357
3361
  [
3358
- '9800',
3362
+ '9550',
3359
3363
  '9999'
3360
3364
  ]
3361
3365
  ]
@@ -3365,11 +3369,11 @@ module.exports = {
3365
3369
  ranges: [
3366
3370
  [
3367
3371
  '40',
3368
- '49'
3372
+ '52'
3369
3373
  ],
3370
3374
  [
3371
3375
  '700',
3372
- '749'
3376
+ '774'
3373
3377
  ],
3374
3378
  [
3375
3379
  '9600',
@@ -3411,7 +3415,7 @@ module.exports = {
3411
3415
  ],
3412
3416
  [
3413
3417
  '600',
3414
- '749'
3418
+ '799'
3415
3419
  ],
3416
3420
  [
3417
3421
  '9500',
@@ -3477,7 +3481,7 @@ module.exports = {
3477
3481
  '599'
3478
3482
  ],
3479
3483
  [
3480
- '9500',
3484
+ '9000',
3481
3485
  '9999'
3482
3486
  ]
3483
3487
  ]
@@ -6588,10 +6592,10 @@ module.exports = {
6588
6592
  ranges: [
6589
6593
  [
6590
6594
  '0',
6591
- '4'
6595
+ '3'
6592
6596
  ],
6593
6597
  [
6594
- '50',
6598
+ '40',
6595
6599
  '79'
6596
6600
  ],
6597
6601
  [
@@ -6706,7 +6710,7 @@ module.exports = {
6706
6710
  name: 'Luxembourg',
6707
6711
  ranges: [
6708
6712
  [
6709
- '850',
6713
+ '700',
6710
6714
  '999'
6711
6715
  ]
6712
6716
  ]
@@ -6762,6 +6766,23 @@ module.exports = {
6762
6766
  ]
6763
6767
  ]
6764
6768
  },
6769
+ '978-99992': {
6770
+ name: 'Oman',
6771
+ ranges: [
6772
+ [
6773
+ '0',
6774
+ '1'
6775
+ ],
6776
+ [
6777
+ '50',
6778
+ '64'
6779
+ ],
6780
+ [
6781
+ '950',
6782
+ '999'
6783
+ ]
6784
+ ]
6785
+ },
6765
6786
  '979-10': {
6766
6787
  name: 'France',
6767
6788
  ranges: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "isbn3",
3
3
  "description": "ISBN utils: parse, validate, format, audit",
4
- "version": "1.1.32",
4
+ "version": "1.1.34",
5
5
  "authors": [
6
6
  "Hetappi <hetappi.pm@gmail.com>",
7
7
  "Tadas S. <tadas@yoyo.lt>",
@@ -31,10 +31,12 @@
31
31
  },
32
32
  "files": [
33
33
  "isbn.js",
34
+ "isbn.d.ts",
34
35
  "lib",
35
36
  "bin",
36
37
  "scripts"
37
38
  ],
39
+ "types": "isbn.d.ts",
38
40
  "engines": {
39
41
  "node": ">= 6.4.0"
40
42
  },
@@ -76,6 +78,5 @@
76
78
  "audit",
77
79
  "publisher",
78
80
  "checksum"
79
- ],
80
- "types": "isbn.d.ts"
81
+ ]
81
82
  }