isbn3 1.1.31 → 1.1.33
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/isbn.d.ts +44 -0
- package/package.json +3 -1
- package/CHANGELOG.md +0 -24
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/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.
|
|
4
|
+
"version": "1.1.33",
|
|
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
|
},
|
package/CHANGELOG.md
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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`
|