diff --git a/CHANGES.md b/CHANGES.md index d4394f7..4288b7e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +## Version 0.3.1, 2017.11.03 + +* Error thrown as context is lost for API methods when using destructuring imports [#22](https://github.com/NotNinja/convert-svg/issues/22) + ## Version 0.3.0, 2017.11.03 * Add option to control background color [#14](https://github.com/NotNinja/convert-svg/issues/14) diff --git a/lerna.json b/lerna.json index 9afb8e6..0989fdf 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "lerna": "2.4.0", - "version": "0.3.0", + "version": "0.3.1", "packages": [ "packages/*" ], diff --git a/packages/convert-svg-core/package.json b/packages/convert-svg-core/package.json index f63b570..296ec5f 100644 --- a/packages/convert-svg-core/package.json +++ b/packages/convert-svg-core/package.json @@ -1,6 +1,6 @@ { "name": "convert-svg-core", - "version": "0.3.0", + "version": "0.3.1", "description": "Supports converting SVG into another format using headless Chromium", "homepage": "https://github.com/NotNinja/convert-svg", "bugs": { diff --git a/packages/convert-svg-core/src/API.js b/packages/convert-svg-core/src/API.js index a570384..d9172ea 100644 --- a/packages/convert-svg-core/src/API.js +++ b/packages/convert-svg-core/src/API.js @@ -41,6 +41,11 @@ class API { */ constructor(provider) { this[_provider] = provider; + + // Workaround for #22 by ensuring all public methods are bound to this instance + this.convert = this.convert.bind(this); + this.convertFile = this.convertFile.bind(this); + this.createConverter = this.createConverter.bind(this); } /** diff --git a/packages/convert-svg-to-jpeg/package.json b/packages/convert-svg-to-jpeg/package.json index 8b21a4b..00ab380 100644 --- a/packages/convert-svg-to-jpeg/package.json +++ b/packages/convert-svg-to-jpeg/package.json @@ -1,6 +1,6 @@ { "name": "convert-svg-to-jpeg", - "version": "0.3.0", + "version": "0.3.1", "description": "Converts SVG to JPEG using headless Chromium", "homepage": "https://github.com/NotNinja/convert-svg", "bugs": { @@ -26,7 +26,7 @@ "url": "https://github.com/NotNinja/convert-svg.git" }, "dependencies": { - "convert-svg-core": "^0.3.0" + "convert-svg-core": "^0.3.1" }, "devDependencies": { "chai": "^4.1.2", diff --git a/packages/convert-svg-to-png/package.json b/packages/convert-svg-to-png/package.json index 16a0efd..9ba4b5d 100644 --- a/packages/convert-svg-to-png/package.json +++ b/packages/convert-svg-to-png/package.json @@ -1,6 +1,6 @@ { "name": "convert-svg-to-png", - "version": "0.3.0", + "version": "0.3.1", "description": "Converts SVG to PNG using headless Chromium", "homepage": "https://github.com/NotNinja/convert-svg", "bugs": { @@ -25,7 +25,7 @@ "url": "https://github.com/NotNinja/convert-svg.git" }, "dependencies": { - "convert-svg-core": "^0.3.0" + "convert-svg-core": "^0.3.1" }, "devDependencies": { "chai": "^4.1.2",