isbn3 2.0.4 → 2.0.5

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 (2) hide show
  1. package/isbn.d.ts +19 -12
  2. package/package.json +1 -1
package/isbn.d.ts CHANGED
@@ -17,26 +17,33 @@ interface ISBNBase {
17
17
  article: string;
18
18
  check: string;
19
19
  groupname: string;
20
- }
21
20
 
22
- interface ISBN10 extends ISBNBase {
23
- isIsbn10: true;
24
- isIsbn13: false;
25
- check10: string;
26
- isbn10: string;
27
- isbn10h: string;
28
- }
21
+ // input related fields
22
+ isIsbn10: boolean;
23
+ isIsbn13: boolean;
29
24
 
30
- interface ISBN13 extends ISBNBase {
31
- isIsbn10: false;
32
- isIsbn13: true;
25
+ // isbn13 related fields
33
26
  prefix: string;
34
27
  check13: string;
35
28
  isbn13: string;
36
29
  isbn13h: string;
37
30
  }
38
31
 
39
- type ISBN = ISBN10 | ISBN13;
32
+ // ISBN-13 only (no ISBN-10 equivalent)
33
+ interface ISBN13Only extends ISBNBase {
34
+ isbn10: undefined;
35
+ check10: undefined;
36
+ isbn10h: undefined;
37
+ }
38
+
39
+ // ISBN-10 specific fields
40
+ interface ISBN13WithISBN10 extends ISBNBase {
41
+ isbn10: string;
42
+ check10: string;
43
+ isbn10h: string;
44
+ }
45
+
46
+ type ISBN = ISBN13WithISBN10 | ISBN13Only;
40
47
 
41
48
  declare module "isbn3" {
42
49
  export function parse(isbn: string): ISBN | null;
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": "2.0.4",
4
+ "version": "2.0.5",
5
5
  "authors": [
6
6
  "Hetappi <hetappi.pm@gmail.com>",
7
7
  "Tadas S. <tadas@yoyo.lt>",