Skip to content

Commit

Permalink
🚑️ Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ynhhoJ committed Jul 7, 2024
1 parent ccc30d5 commit a5b8969
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
7 changes: 6 additions & 1 deletion src/api/getBooksByAuthorOpds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 6 additions & 1 deletion src/api/getBooksByNameOpds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down

0 comments on commit a5b8969

Please sign in to comment.