diff --git a/package-lock.json b/package-lock.json index 050d07e..522c183 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppt-png", - "version": "2.1.1", + "version": "2.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ppt-png", - "version": "2.1.1", + "version": "2.1.2", "license": "MIT", "dependencies": { "@hckrnews/converter": "^0.5.2", @@ -1885,7 +1885,6 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", "dev": true, - "license": "MIT", "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.9.1" @@ -4445,7 +4444,6 @@ "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.1.tgz", "integrity": "sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==", "dev": true, - "license": "MIT", "dependencies": { "@pkgr/core": "^0.1.0", "tslib": "^2.6.2" diff --git a/package.json b/package.json index 6545168..ed9a5b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ppt-png", - "version": "2.1.1", + "version": "2.1.2", "description": "Convert ppt to image (png,jpg)", "files": [ "src/converter.js", diff --git a/src/__tests__/converter.test.js b/src/__tests__/converter.test.js index 0f48ec6..1522538 100644 --- a/src/__tests__/converter.test.js +++ b/src/__tests__/converter.test.js @@ -23,8 +23,8 @@ test('PPT-PNG converter test', async (t) => { output: 'output/', options: { density: 300, - quality: 100 - } + quality: 100, + }, }); const result = converter.convert(); @@ -33,6 +33,8 @@ test('PPT-PNG converter test', async (t) => { result[0].file.path, 'output/OPW 733 Tienduizend redenen.pdf' ); + assert.strictEqual(converter.density, 300); + assert.strictEqual(converter.quality, 100); assert.strictEqual( fileExists('output/OPW 733 Tienduizend redenen.pdf'), true diff --git a/src/converter.js b/src/converter.js index b9ff14b..4eebbd5 100644 --- a/src/converter.js +++ b/src/converter.js @@ -15,6 +15,8 @@ class Ppt2PngConverter extends Converter { constructor() { super(); this.files = []; + this.density = null; + this.quality = null; } /** @@ -67,8 +69,8 @@ class Ppt2PngConverter extends Converter { converter.setFiles(files); converter.setOutput(output); - converter.density = (options && options.density) || undefined; - converter.quality = (options && options.quality) || undefined; + converter.density = options?.density; + converter.quality = options?.quality; return converter; }