File tree Expand file tree Collapse file tree 3 files changed +24
-16
lines changed Expand file tree Collapse file tree 3 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -146,18 +146,16 @@ function generateHTML(sourceCode, options) {
146
146
*/
147
147
148
148
function codeSnipper ( fileName , options = opts ) {
149
- options = {
150
- ...opts ,
151
- ext : checkFileExtension ( fileName ) ,
152
- ...options
153
- } ;
149
+ options = Object . assign (
150
+ opts ,
151
+ { ext : checkFileExtension ( fileName ) } ,
152
+ options ) ;
154
153
155
154
// Initialize webshot's configuration, setting resolution(zoomFactor) if passed.
156
- let webshotConfig = {
155
+ let webshotConfig = Object . assign ( {
157
156
siteType : 'html' ,
158
- zoomFactor : options . resolution || 2.5 ,
159
- ...options . webshotCustomConfig
160
- } ;
157
+ zoomFactor : options . resolution || 2.5 } ,
158
+ options . webshotCustomConfig || { } ) ;
161
159
162
160
const imagePath = path . join ( process . cwd ( ) , fileName ) ;
163
161
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " code-snipper" ,
3
- "version" : " 0.0.22 " ,
3
+ "version" : " 0.0.23 " ,
4
4
"description" : " Export code snippets as PNG" ,
5
5
"main" : " code-snipper.js" ,
6
6
"scripts" : {
13
13
"gm" : " ^1.23.0" ,
14
14
"prettier" : " ^0.22.0" ,
15
15
"standard" : " ^10.0.2" ,
16
- "taffydb" : " ^2.7.3" ,
17
16
"untildify" : " ^3.0.2" ,
18
17
"webshot" : " ^0.18.0" ,
19
18
"yargs" : " ^7.0.2"
Original file line number Diff line number Diff line change @@ -607,6 +607,10 @@ esprima@^3.1.1:
607
607
version "3.1.3"
608
608
resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
609
609
610
+ esprima@^4.0.0 :
611
+ version "4.0.0"
612
+ resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
613
+
610
614
esquery@^1.0.0 :
611
615
version "1.0.0"
612
616
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa"
@@ -1063,7 +1067,14 @@ js-tokens@^3.0.0:
1063
1067
version "3.0.2"
1064
1068
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
1065
1069
1066
- js-yaml@^3.2.7, js-yaml@^3.5.1 :
1070
+ js-yaml@^3.2.7 :
1071
+ version "3.10.0"
1072
+ resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc"
1073
+ dependencies :
1074
+ argparse "^1.0.7"
1075
+ esprima "^4.0.0"
1076
+
1077
+ js-yaml@^3.5.1 :
1067
1078
version "3.8.4"
1068
1079
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6"
1069
1080
dependencies :
@@ -1779,10 +1790,6 @@ table@^3.7.8:
1779
1790
slice-ansi "0.0.4"
1780
1791
string-width "^2.0.0"
1781
1792
1782
- taffydb@^2.7.3 :
1783
- version "2.7.3"
1784
- resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.7.3.tgz#2ad37169629498fca5bc84243096d3cde0ec3a34"
1785
-
1786
1793
tap-nyan@^1.1.0 :
1787
1794
version "1.1.0"
1788
1795
resolved "https://registry.yarnpkg.com/tap-nyan/-/tap-nyan-1.1.0.tgz#2b8d13a1f9ca51c1b3ada0c6ccdb1177d2065bb0"
@@ -1869,6 +1876,10 @@ uniq@^1.0.1:
1869
1876
version "1.0.1"
1870
1877
resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff"
1871
1878
1879
+ untildify@^3.0.2 :
1880
+ version "3.0.2"
1881
+ resolved "https://registry.yarnpkg.com/untildify/-/untildify-3.0.2.tgz#7f1f302055b3fea0f3e81dc78eb36766cb65e3f1"
1882
+
1872
1883
user-home@^2.0.0 :
1873
1884
version "2.0.0"
1874
1885
resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f"
You can’t perform that action at this time.
0 commit comments