From 29bc3b50863a6dce40563c70155080c306b9eb91 Mon Sep 17 00:00:00 2001 From: Alexander Wunschik Date: Fri, 9 Dec 2022 22:51:36 +0100 Subject: [PATCH] 4.2.0 --- browser.d.ts | 3 ++- browser.js | 4 ++-- index.js | 4 ++-- package-lock.json | 2 +- package.json | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/browser.d.ts b/browser.d.ts index a5d3330..81b982e 100644 --- a/browser.d.ts +++ b/browser.d.ts @@ -1,7 +1,8 @@ -// Type definitions for pdf-merger-js v3.4.0 +// Type definitions for pdf-merger-js v4.2.0 // Project: https://github.com/nbesli/pdf-merger-js // Definitions by: Alexander Wunschik // Daniel Hammer +// Lukas Loeffler declare module "pdf-merger-js/browser" { class PDFMerger { diff --git a/browser.js b/browser.js index 2ef46d2..7f50da3 100644 --- a/browser.js +++ b/browser.js @@ -84,7 +84,7 @@ class PDFMerger { async _addFromToPage (inputFile, from, to) { if (typeof from !== 'number' || typeof to !== 'number' || from < 0 || from < 0) { - throw new Error('Invalid function parameter. \'from\' and \'to\' must be possitive \'numbers\'.') + throw new Error('Invalid function parameter. \'from\' and \'to\' must be positive \'numbers\'.') } if (to < from) { throw new Error('Invalid function parameter. \'to\' must be greater or eaqual to \'from\'.') @@ -95,7 +95,7 @@ class PDFMerger { const pageCount = srcDoc.getPageCount() if (from >= pageCount || to >= pageCount) { - throw new Error(`Invalid function parameter. The document has not enought pages. (from:${from}, to:${to}, pages:${pageCount})`) + throw new Error(`Invalid function parameter. The document has not enough pages. (from:${from}, to:${to}, pages:${pageCount})`) } // create a array [2,3,4] with from=2 and to=4 diff --git a/index.js b/index.js index ee1dbb8..a59e304 100644 --- a/index.js +++ b/index.js @@ -61,7 +61,7 @@ class PDFMerger { async _addFromToPage (input, from, to) { if (typeof from !== 'number' || typeof to !== 'number' || from < 1 || from < 1) { - throw new Error('Invalid function parameter. \'from\' and \'to\' must be possitive \'numbers\'.') + throw new Error('Invalid function parameter. \'from\' and \'to\' must be positive \'numbers\'.') } if (to < from) { throw new Error('Invalid function parameter. \'to\' must be greater or equal to \'from\'.') @@ -72,7 +72,7 @@ class PDFMerger { const pageCount = srcDoc.getPageCount() if (from > pageCount || to > pageCount) { - throw new Error(`Invalid function parameter. The document has not enought pages. (from:${from}, to:${to}, pages:${pageCount})`) + throw new Error(`Invalid function parameter. The document has not enough pages. (from:${from}, to:${to}, pages:${pageCount})`) } const pages = Array.from({ length: (to - from) + 1 }, (_, i) => i + from - 1) diff --git a/package-lock.json b/package-lock.json index f75f31c..c2e2e49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "pdf-merger-js", - "version": "4.1.2", + "version": "4.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a7003fc..5b9ac59 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pdf-merger-js", - "version": "4.1.2", - "description": "merge multible PDF documents, or parts of them, to a new PDF document", + "version": "4.2.0", + "description": "merge multiple PDF documents, or parts of them, to a new PDF document", "main": "./index.js", "types": "./index.d.ts", "browser": "./browser.js",