Skip to content

Commit 29bc3b5

Browse files
committed
4.2.0
1 parent 7e59050 commit 29bc3b5

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

browser.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// Type definitions for pdf-merger-js v3.4.0
1+
// Type definitions for pdf-merger-js v4.2.0
22
// Project: https://github.com/nbesli/pdf-merger-js
33
// Definitions by: Alexander Wunschik <https://github.com/mojoaxel/>
44
// Daniel Hammer <https://github.com/danmhammer/>
5+
// Lukas Loeffler <https://github.com/LukasLoeffler>
56

67
declare module "pdf-merger-js/browser" {
78
class PDFMerger {

browser.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class PDFMerger {
8484

8585
async _addFromToPage (inputFile, from, to) {
8686
if (typeof from !== 'number' || typeof to !== 'number' || from < 0 || from < 0) {
87-
throw new Error('Invalid function parameter. \'from\' and \'to\' must be possitive \'numbers\'.')
87+
throw new Error('Invalid function parameter. \'from\' and \'to\' must be positive \'numbers\'.')
8888
}
8989
if (to < from) {
9090
throw new Error('Invalid function parameter. \'to\' must be greater or eaqual to \'from\'.')
@@ -95,7 +95,7 @@ class PDFMerger {
9595
const pageCount = srcDoc.getPageCount()
9696

9797
if (from >= pageCount || to >= pageCount) {
98-
throw new Error(`Invalid function parameter. The document has not enought pages. (from:${from}, to:${to}, pages:${pageCount})`)
98+
throw new Error(`Invalid function parameter. The document has not enough pages. (from:${from}, to:${to}, pages:${pageCount})`)
9999
}
100100

101101
// create a array [2,3,4] with from=2 and to=4

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class PDFMerger {
6161

6262
async _addFromToPage (input, from, to) {
6363
if (typeof from !== 'number' || typeof to !== 'number' || from < 1 || from < 1) {
64-
throw new Error('Invalid function parameter. \'from\' and \'to\' must be possitive \'numbers\'.')
64+
throw new Error('Invalid function parameter. \'from\' and \'to\' must be positive \'numbers\'.')
6565
}
6666
if (to < from) {
6767
throw new Error('Invalid function parameter. \'to\' must be greater or equal to \'from\'.')
@@ -72,7 +72,7 @@ class PDFMerger {
7272
const pageCount = srcDoc.getPageCount()
7373

7474
if (from > pageCount || to > pageCount) {
75-
throw new Error(`Invalid function parameter. The document has not enought pages. (from:${from}, to:${to}, pages:${pageCount})`)
75+
throw new Error(`Invalid function parameter. The document has not enough pages. (from:${from}, to:${to}, pages:${pageCount})`)
7676
}
7777

7878
const pages = Array.from({ length: (to - from) + 1 }, (_, i) => i + from - 1)

package-lock.json

+1-1
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,7 +1,7 @@
11
{
22
"name": "pdf-merger-js",
3-
"version": "4.1.2",
4-
"description": "merge multible PDF documents, or parts of them, to a new PDF document",
3+
"version": "4.2.0",
4+
"description": "merge multiple PDF documents, or parts of them, to a new PDF document",
55
"main": "./index.js",
66
"types": "./index.d.ts",
77
"browser": "./browser.js",

0 commit comments

Comments
 (0)