Skip to content

Commit 2406df6

Browse files
authored
Merge pull request #46 from ynhhoJ/bugfixes/yarn-conflict
Fixed builds
2 parents ccc30d5 + ac99b71 commit 2406df6

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flibusta",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"author": "ynhhoJ",
55
"description": "Unofficial Flibusta API based on website search engine. If you like to read books - buy",
66
"license": "MIT",
@@ -29,7 +29,7 @@
2929
"example-search-genres-paginated": "ts-node ./examples/searchGenresPaginated.ts",
3030
"test": "npm run test:specific 'tests/**/*.ts'",
3131
"test:specific": "npx nyc mocha --timeout 15000 --node-flags '--unhandled-rejections=strict' -r ts-node/register",
32-
"build": "webpack && yarn copy-types",
32+
"build": "webpack && npm run copy-types",
3333
"copy-types": "copyfiles -u 1 types/**/* build/types"
3434
},
3535
"dependencies": {

src/api/getBooksByAuthorOpds.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ class GetBooksByAuthorOpds extends FlibustaAPIHelper {
6969
return undefined;
7070
}
7171

72-
const slicedEntryToLimit = entry.slice(0, limit);
72+
let slicedEntryToLimit = entry;
73+
74+
if (Array.isArray(slicedEntryToLimit)) {
75+
slicedEntryToLimit = slicedEntryToLimit.slice(0, limit);
76+
}
77+
7378
const items = this.prepareResponseFromOpdsEntry(slicedEntryToLimit);
7479
const pages = this.getCurrentOpdsPageInformation(feed, page);
7580

src/api/getBooksByNameOpds.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ class GetBooksByNameOpds extends FlibustaAPIHelper {
9494
return undefined;
9595
}
9696

97-
const slicedEntryToLimit = entry.slice(0, limit);
97+
let slicedEntryToLimit = entry;
98+
99+
if (Array.isArray(slicedEntryToLimit)) {
100+
slicedEntryToLimit = slicedEntryToLimit.slice(0, limit);
101+
}
102+
98103
const items = this.prepareResponseFromOpdsEntry(slicedEntryToLimit);
99104
const pages = this.getCurrentSearchOpdsPageInformation(feed);
100105
const totalCountItems = feed['os:totalResults'];

0 commit comments

Comments
 (0)