@library-pals/isbn 1.4.1 → 1.4.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/package.json +10 -10
- package/src/providers/open-library.js +13 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@library-pals/isbn",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "Find books by ISBN",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"author": "Katy DeCorah <@katydecorah>",
|
|
38
38
|
"license": "AGPL-3.0-or-later",
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@eslint/js": "^9.
|
|
41
|
-
"eslint": "^9.
|
|
42
|
-
"eslint-plugin-jest": "^28.
|
|
43
|
-
"eslint-plugin-jsdoc": "^50.
|
|
44
|
-
"eslint-plugin-unicorn": "^
|
|
45
|
-
"globals": "^15.
|
|
40
|
+
"@eslint/js": "^9.17.0",
|
|
41
|
+
"eslint": "^9.17.0",
|
|
42
|
+
"eslint-plugin-jest": "^28.10.0",
|
|
43
|
+
"eslint-plugin-jsdoc": "^50.6.1",
|
|
44
|
+
"eslint-plugin-unicorn": "^56.0.1",
|
|
45
|
+
"globals": "^15.14.0",
|
|
46
46
|
"jest": "^29.7.0",
|
|
47
|
-
"prettier": "^3.
|
|
47
|
+
"prettier": "^3.4.2",
|
|
48
48
|
"prettier-2": "npm:prettier@^2",
|
|
49
|
-
"typescript": "^5.
|
|
49
|
+
"typescript": "^5.7.2"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"axios": "^1.7.
|
|
52
|
+
"axios": "^1.7.9"
|
|
53
53
|
},
|
|
54
54
|
"bugs": {
|
|
55
55
|
"url": "https://github.com/library-pals/isbn/issues"
|
|
@@ -110,7 +110,7 @@ export async function standardize(book, isbn) {
|
|
|
110
110
|
const standardBook = {
|
|
111
111
|
title: book.title,
|
|
112
112
|
authors,
|
|
113
|
-
description,
|
|
113
|
+
description: handleDescription(description),
|
|
114
114
|
pageCount: book.number_of_pages,
|
|
115
115
|
format: "book",
|
|
116
116
|
categories: subjects,
|
|
@@ -128,6 +128,18 @@ export async function standardize(book, isbn) {
|
|
|
128
128
|
return standardBook;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Handles the description of the book.
|
|
133
|
+
* @param {string|object} description - The description of the book.
|
|
134
|
+
* @returns {string} - The processed description.
|
|
135
|
+
*/
|
|
136
|
+
function handleDescription(description) {
|
|
137
|
+
if (typeof description === "string") {
|
|
138
|
+
return description;
|
|
139
|
+
}
|
|
140
|
+
return description.value;
|
|
141
|
+
}
|
|
142
|
+
|
|
131
143
|
/**
|
|
132
144
|
* Retrieves the author names from OpenLibrary.
|
|
133
145
|
* @param {{key: string}[]} rawAuthors - List of author keys.
|