Skip to content

Commit

Permalink
v3.18.0 feat: add disable log option log. (#183) 51fd8c5
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 24, 2022
1 parent 5d25ef1 commit 818957b
Show file tree
Hide file tree
Showing 30 changed files with 671 additions and 439 deletions.
8 changes: 4 additions & 4 deletions badges.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions coverage-summary.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{"total": {"lines":{"total":269,"covered":239,"skipped":0,"pct":88.84},"statements":{"total":285,"covered":250,"skipped":0,"pct":87.71},"functions":{"total":60,"covered":56,"skipped":0,"pct":93.33},"branches":{"total":173,"covered":116,"skipped":0,"pct":67.05},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
{"total": {"lines":{"total":280,"covered":248,"skipped":0,"pct":88.57},"statements":{"total":298,"covered":259,"skipped":0,"pct":86.91},"functions":{"total":67,"covered":60,"skipped":0,"pct":89.55},"branches":{"total":181,"covered":121,"skipped":0,"pct":66.85},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
,"/home/runner/work/svgtofont/svgtofont/src/cli.ts": {"lines":{"total":11,"covered":0,"skipped":0,"pct":0},"functions":{"total":2,"covered":0,"skipped":0,"pct":0},"statements":{"total":11,"covered":0,"skipped":0,"pct":0},"branches":{"total":6,"covered":0,"skipped":0,"pct":0}}
,"/home/runner/work/svgtofont/svgtofont/src/generate.ts": {"lines":{"total":36,"covered":35,"skipped":0,"pct":97.22},"functions":{"total":11,"covered":11,"skipped":0,"pct":100},"statements":{"total":41,"covered":40,"skipped":0,"pct":97.56},"branches":{"total":27,"covered":17,"skipped":0,"pct":62.96}}
,"/home/runner/work/svgtofont/svgtofont/src/index.ts": {"lines":{"total":97,"covered":93,"skipped":0,"pct":95.87},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":102,"covered":97,"skipped":0,"pct":95.09},"branches":{"total":85,"covered":69,"skipped":0,"pct":81.17}}
,"/home/runner/work/svgtofont/svgtofont/src/index.ts": {"lines":{"total":98,"covered":94,"skipped":0,"pct":95.91},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":103,"covered":98,"skipped":0,"pct":95.14},"branches":{"total":87,"covered":71,"skipped":0,"pct":81.6}}
,"/home/runner/work/svgtofont/svgtofont/src/log.ts": {"lines":{"total":10,"covered":8,"skipped":0,"pct":80},"functions":{"total":7,"covered":4,"skipped":0,"pct":57.14},"statements":{"total":12,"covered":8,"skipped":0,"pct":66.66},"branches":{"total":6,"covered":3,"skipped":0,"pct":50}}
,"/home/runner/work/svgtofont/svgtofont/src/utils.ts": {"lines":{"total":125,"covered":111,"skipped":0,"pct":88.8},"functions":{"total":43,"covered":41,"skipped":0,"pct":95.34},"statements":{"total":131,"covered":113,"skipped":0,"pct":86.25},"branches":{"total":55,"covered":30,"skipped":0,"pct":54.54}}
}
8 changes: 4 additions & 4 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
/* IE9*/
src: url("svgtofont.eot#iefix") format("embedded-opentype"),
/* IE6-IE8 */
url("svgtofont.woff2?1666603520093") format("woff2"),
url("svgtofont.woff?1666603520093") format("woff"),
url("svgtofont.woff2?1666605679954") format("woff2"),
url("svgtofont.woff?1666605679954") format("woff"),
/* chrome, firefox */
url("svgtofont.ttf?1666603520093") format("truetype"),
url("svgtofont.ttf?1666605679954") format("truetype"),
/* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url("svgtofont.svg#svgtofont?1666603520093") format("svg");
url("svgtofont.svg#svgtofont?1666605679954") format("svg");
/* iOS 4.1- */
}
.iconfont {
Expand Down
12 changes: 6 additions & 6 deletions example/svgtofont.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@font-face {
font-family: "svgtofont";
src: url('svgtofont.eot?t=1666603520074'); /* IE9*/
src: url('svgtofont.eot?t=1666603520074#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("svgtofont.woff2?t=1666603520074") format("woff2"),
url("svgtofont.woff?t=1666603520074") format("woff"),
url('svgtofont.ttf?t=1666603520074') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('svgtofont.svg?t=1666603520074#svgtofont') format('svg'); /* iOS 4.1- */
src: url('svgtofont.eot?t=1666605679936'); /* IE9*/
src: url('svgtofont.eot?t=1666605679936#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("svgtofont.woff2?t=1666605679936") format("woff2"),
url("svgtofont.woff?t=1666605679936") format("woff"),
url('svgtofont.ttf?t=1666605679936') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('svgtofont.svg?t=1666605679936#svgtofont') format('svg'); /* iOS 4.1- */
}

[class^="svgtofont-"], [class*=" svgtofont-"] {
Expand Down
Binary file modified example/svgtofont.eot
Binary file not shown.
12 changes: 6 additions & 6 deletions example/svgtofont.less
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@font-face {font-family: "svgtofont";
src: url('svgtofont.eot?t=1666603520074'); /* IE9*/
src: url('svgtofont.eot?t=1666603520074#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("svgtofont.woff2?t=1666603520074") format("woff2"),
url("svgtofont.woff?t=1666603520074") format("woff"),
url('svgtofont.ttf?t=1666603520074') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('svgtofont.svg?t=1666603520074#svgtofont') format('svg'); /* iOS 4.1- */
src: url('svgtofont.eot?t=1666605679936'); /* IE9*/
src: url('svgtofont.eot?t=1666605679936#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("svgtofont.woff2?t=1666605679936") format("woff2"),
url("svgtofont.woff?t=1666605679936") format("woff"),
url('svgtofont.ttf?t=1666605679936') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('svgtofont.svg?t=1666605679936#svgtofont') format('svg'); /* iOS 4.1- */
}

[class^="svgtofont-"], [class*=" svgtofont-"] {
Expand Down
12 changes: 6 additions & 6 deletions example/svgtofont.module.less
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@font-face {font-family: "svgtofont";
src: url('svgtofont.eot?t=1666603520074'); /* IE9*/
src: url('svgtofont.eot?t=1666603520074#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("svgtofont.woff2?t=1666603520074") format("woff2"),
url("svgtofont.woff?t=1666603520074") format("woff"),
url('svgtofont.ttf?t=1666603520074') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('svgtofont.svg?t=1666603520074#svgtofont') format('svg'); /* iOS 4.1- */
src: url('svgtofont.eot?t=1666605679936'); /* IE9*/
src: url('svgtofont.eot?t=1666605679936#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("svgtofont.woff2?t=1666605679936") format("woff2"),
url("svgtofont.woff?t=1666605679936") format("woff"),
url('svgtofont.ttf?t=1666605679936') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('svgtofont.svg?t=1666605679936#svgtofont') format('svg'); /* iOS 4.1- */
}

[class^="svgtofont-"], [class*=" svgtofont-"] {
Expand Down
12 changes: 6 additions & 6 deletions example/svgtofont.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@font-face {font-family: "svgtofont";
src: url('svgtofont.eot?t=1666603520074'); /* IE9*/
src: url('svgtofont.eot?t=1666603520074#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("svgtofont.woff2?t=1666603520074") format("woff2"),
url("svgtofont.woff?t=1666603520074") format("woff"),
url('svgtofont.ttf?t=1666603520074') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('svgtofont.svg?t=1666603520074#svgtofont') format('svg'); /* iOS 4.1- */
src: url('svgtofont.eot?t=1666605679936'); /* IE9*/
src: url('svgtofont.eot?t=1666605679936#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("svgtofont.woff2?t=1666605679936") format("woff2"),
url("svgtofont.woff?t=1666605679936") format("woff"),
url('svgtofont.ttf?t=1666605679936') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('svgtofont.svg?t=1666605679936#svgtofont') format('svg'); /* iOS 4.1- */
}

[class^="svgtofont-"], [class*=" svgtofont-"] {
Expand Down
12 changes: 6 additions & 6 deletions example/svgtofont.styl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@font-face {font-family: "svgtofont";
src: url('svgtofont.eot?t=1666603520074'); /* IE9*/
src: url('svgtofont.eot?t=1666603520074#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("svgtofont.woff2?t=1666603520074") format("woff2"),
url("svgtofont.woff?t=1666603520074") format("woff"),
url('svgtofont.ttf?t=1666603520074') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('svgtofont.svg?t=1666603520074#svgtofont') format('svg'); /* iOS 4.1- */
src: url('svgtofont.eot?t=1666605679936'); /* IE9*/
src: url('svgtofont.eot?t=1666605679936#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("svgtofont.woff2?t=1666605679936") format("woff2"),
url("svgtofont.woff?t=1666605679936") format("woff"),
url('svgtofont.ttf?t=1666605679936') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('svgtofont.svg?t=1666605679936#svgtofont') format('svg'); /* iOS 4.1- */
}

[class^="svgtofont-"], [class*=" svgtofont-"] {
Expand Down
Binary file modified example/svgtofont.ttf
Binary file not shown.
Binary file modified example/svgtofont.woff
Binary file not shown.
Binary file modified example/svgtofont.woff2
Binary file not shown.
8 changes: 8 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,14 @@ <h2 id="options"><a class="anchor" aria-hidden="true" tabindex="-1" href="#optio
<blockquote>
<p>svgtofont(options)</p>
</blockquote>
<pre><code class="code-highlight"><span class="code-line line-number" line="1">"log": false,
</span></code><div onclick="copied(this)" data-code="&#x22;log&#x22;: false,
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
<h3 id="log"><a class="anchor" aria-hidden="true" tabindex="-1" href="#log"><span class="octicon octicon-link"></span></a>log</h3>
<blockquote>
<p>Type: <code>Boolean</code></p>
</blockquote>
<p>A value of <code>false</code> disables logging</p>
<h3 id="dist"><a class="anchor" aria-hidden="true" tabindex="-1" href="#dist"><span class="octicon octicon-link"></span></a>dist</h3>
<blockquote>
<p>Type: <code>String</code><br>Default value: <del><code>dist</code></del> => <code>fonts</code></p>
Expand Down
13 changes: 8 additions & 5 deletions lcov-report/cli.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ <h1><a href="index.html">All files</a> cli.ts</h1>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -181,6 +183,7 @@ <h1><a href="index.html">All files</a> cli.ts</h1>
import yargs, { Arguments } from 'yargs';
import path from 'path';
import svgtofont from './';
import { log } from './log';
&nbsp;
type ArgvResult = Arguments&lt;{
sources: string;
Expand All @@ -205,7 +208,7 @@ <h1><a href="index.html">All files</a> cli.ts</h1>
const outputPath = <span class="cstat-no" title="statement not covered" >path.join(process.cwd(), argv.output);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >if (!FS.pathExistsSync(sourcesPath)) {</span>
<span class="cstat-no" title="statement not covered" > console.error('The directory does not exist!', sourcesPath);</span>
<span class="cstat-no" title="statement not covered" > log.error('The directory does not exist!', sourcesPath);</span>
<span class="cstat-no" title="statement not covered" > process.exit();</span>
}
&nbsp;
Expand All @@ -227,9 +230,9 @@ <h1><a href="index.html">All files</a> cli.ts</h1>
},
})
.then(<span class="fstat-no" title="function not covered" >()</span> =&gt; {
<span class="cstat-no" title="statement not covered" > console.log('done!');</span>
<span class="cstat-no" title="statement not covered" > log.log('done!');</span>
}).catch(<span class="fstat-no" title="function not covered" >(e</span>rr) =&gt; {
<span class="cstat-no" title="statement not covered" > console.log('SvgToFont:ERR:', err);</span>
<span class="cstat-no" title="statement not covered" > log.log('SvgToFont:ERR:', err);</span>
});
&nbsp;</pre></td></tr></table></pre>

Expand All @@ -238,7 +241,7 @@ <h1><a href="index.html">All files</a> cli.ts</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-10-24T09:25:19.170Z
at 2022-10-24T10:01:19.068Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion lcov-report/generate.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ <h1><a href="index.html">All files</a> generate.ts</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-10-24T09:25:19.170Z
at 2022-10-24T10:01:19.068Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
47 changes: 31 additions & 16 deletions lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ <h1>All files</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">87.71% </span>
<span class="strong">86.91% </span>
<span class="quiet">Statements</span>
<span class='fraction'>250/285</span>
<span class='fraction'>259/298</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">67.05% </span>
<span class="strong">66.85% </span>
<span class="quiet">Branches</span>
<span class='fraction'>116/173</span>
<span class='fraction'>121/181</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">93.33% </span>
<span class="strong">89.55% </span>
<span class="quiet">Functions</span>
<span class='fraction'>56/60</span>
<span class='fraction'>60/67</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">88.84% </span>
<span class="strong">88.57% </span>
<span class="quiet">Lines</span>
<span class='fraction'>239/269</span>
<span class='fraction'>248/280</span>
</div>


Expand Down Expand Up @@ -110,17 +110,32 @@ <h1>All files</h1>

<tr>
<td class="file high" data-value="index.ts"><a href="index.ts.html">index.ts</a></td>
<td data-value="95.09" class="pic high">
<td data-value="95.14" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 95%"></div><div class="cover-empty" style="width: 5%"></div></div>
</td>
<td data-value="95.09" class="pct high">95.09%</td>
<td data-value="102" class="abs high">97/102</td>
<td data-value="81.17" class="pct high">81.17%</td>
<td data-value="85" class="abs high">69/85</td>
<td data-value="95.14" class="pct high">95.14%</td>
<td data-value="103" class="abs high">98/103</td>
<td data-value="81.6" class="pct high">81.6%</td>
<td data-value="87" class="abs high">71/87</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="95.87" class="pct high">95.87%</td>
<td data-value="97" class="abs high">93/97</td>
<td data-value="95.91" class="pct high">95.91%</td>
<td data-value="98" class="abs high">94/98</td>
</tr>

<tr>
<td class="file medium" data-value="log.ts"><a href="log.ts.html">log.ts</a></td>
<td data-value="66.66" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 66%"></div><div class="cover-empty" style="width: 34%"></div></div>
</td>
<td data-value="66.66" class="pct medium">66.66%</td>
<td data-value="12" class="abs medium">8/12</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="6" class="abs medium">3/6</td>
<td data-value="57.14" class="pct medium">57.14%</td>
<td data-value="7" class="abs medium">4/7</td>
<td data-value="80" class="pct high">80%</td>
<td data-value="10" class="abs high">8/10</td>
</tr>

<tr>
Expand All @@ -146,7 +161,7 @@ <h1>All files</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2022-10-24T09:25:19.170Z
at 2022-10-24T10:01:19.068Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
Loading

0 comments on commit 818957b

Please sign in to comment.