From a5b89690c860d6b883e7801bfa588c45f89584c4 Mon Sep 17 00:00:00 2001 From: ynhhoJ <22500212+ynhhoJ@users.noreply.github.com> Date: Mon, 8 Jul 2024 01:14:10 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20Fix=20build=20error?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/api/getBooksByAuthorOpds.ts | 7 ++++++- src/api/getBooksByNameOpds.ts | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 313b778..36dca80 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "example-search-genres-paginated": "ts-node ./examples/searchGenresPaginated.ts", "test": "npm run test:specific 'tests/**/*.ts'", "test:specific": "npx nyc mocha --timeout 15000 --node-flags '--unhandled-rejections=strict' -r ts-node/register", - "build": "webpack && yarn copy-types", + "build": "webpack && npm run copy-types", "copy-types": "copyfiles -u 1 types/**/* build/types" }, "dependencies": { diff --git a/src/api/getBooksByAuthorOpds.ts b/src/api/getBooksByAuthorOpds.ts index b080af6..b524abc 100644 --- a/src/api/getBooksByAuthorOpds.ts +++ b/src/api/getBooksByAuthorOpds.ts @@ -69,7 +69,12 @@ class GetBooksByAuthorOpds extends FlibustaAPIHelper { return undefined; } - const slicedEntryToLimit = entry.slice(0, limit); + let slicedEntryToLimit = entry; + + if (Array.isArray(slicedEntryToLimit)) { + slicedEntryToLimit = slicedEntryToLimit.slice(0, limit); + } + const items = this.prepareResponseFromOpdsEntry(slicedEntryToLimit); const pages = this.getCurrentOpdsPageInformation(feed, page); diff --git a/src/api/getBooksByNameOpds.ts b/src/api/getBooksByNameOpds.ts index 3c509fe..533a83e 100644 --- a/src/api/getBooksByNameOpds.ts +++ b/src/api/getBooksByNameOpds.ts @@ -94,7 +94,12 @@ class GetBooksByNameOpds extends FlibustaAPIHelper { return undefined; } - const slicedEntryToLimit = entry.slice(0, limit); + let slicedEntryToLimit = entry; + + if (Array.isArray(slicedEntryToLimit)) { + slicedEntryToLimit = slicedEntryToLimit.slice(0, limit); + } + const items = this.prepareResponseFromOpdsEntry(slicedEntryToLimit); const pages = this.getCurrentSearchOpdsPageInformation(feed); const totalCountItems = feed['os:totalResults']; From ac99b710336ab59dde009dfeff7ad2399a85ea21 Mon Sep 17 00:00:00 2001 From: ynhhoJ <22500212+ynhhoJ@users.noreply.github.com> Date: Mon, 8 Jul 2024 01:14:12 +0300 Subject: [PATCH 2/2] 0.5.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f60752e..62f968a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "flibusta", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "flibusta", - "version": "0.5.0", + "version": "0.5.1", "license": "MIT", "dependencies": { "axios": "1.2.6", diff --git a/package.json b/package.json index 36dca80..70d7463 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flibusta", - "version": "0.5.0", + "version": "0.5.1", "author": "ynhhoJ", "description": "Unofficial Flibusta API based on website search engine. If you like to read books - buy", "license": "MIT",