diff --git a/code-snipper.js b/code-snipper.js index 2ad9444..8d2b651 100755 --- a/code-snipper.js +++ b/code-snipper.js @@ -146,18 +146,16 @@ function generateHTML(sourceCode, options) { */ function codeSnipper(fileName, options = opts) { - options = { - ...opts, - ext: checkFileExtension(fileName), - ...options - }; + options = Object.assign( + opts, + { ext: checkFileExtension(fileName) }, + options); // Initialize webshot's configuration, setting resolution(zoomFactor) if passed. - let webshotConfig = { + let webshotConfig = Object.assign({ siteType: 'html', - zoomFactor: options.resolution || 2.5, - ...options.webshotCustomConfig - }; + zoomFactor: options.resolution || 2.5}, + options.webshotCustomConfig || {}); const imagePath = path.join(process.cwd(), fileName); diff --git a/package.json b/package.json index b19d8c7..c5bc1e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "code-snipper", - "version": "0.0.22", + "version": "0.0.23", "description": "Export code snippets as PNG", "main": "code-snipper.js", "scripts": { @@ -13,7 +13,6 @@ "gm": "^1.23.0", "prettier": "^0.22.0", "standard": "^10.0.2", - "taffydb": "^2.7.3", "untildify": "^3.0.2", "webshot": "^0.18.0", "yargs": "^7.0.2" diff --git a/yarn.lock b/yarn.lock index a1a0fda..5532db3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -607,6 +607,10 @@ esprima@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + esquery@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" @@ -1063,7 +1067,14 @@ js-tokens@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.2.7, js-yaml@^3.5.1: +js-yaml@^3.2.7: + version "3.10.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@^3.5.1: version "3.8.4" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" dependencies: @@ -1779,10 +1790,6 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" -taffydb@^2.7.3: - version "2.7.3" - resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.7.3.tgz#2ad37169629498fca5bc84243096d3cde0ec3a34" - tap-nyan@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/tap-nyan/-/tap-nyan-1.1.0.tgz#2b8d13a1f9ca51c1b3ada0c6ccdb1177d2065bb0" @@ -1869,6 +1876,10 @@ uniq@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" +untildify@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/untildify/-/untildify-3.0.2.tgz#7f1f302055b3fea0f3e81dc78eb36766cb65e3f1" + user-home@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f"