Skip to content

Commit

Permalink
Merge pull request #3 from estellepicq/defaultname
Browse files Browse the repository at this point in the history
set default name to export if empty filename
  • Loading branch information
LCluber committed Feb 28, 2019
2 parents 197cbfb + 2e6241c commit 4e0a1c0
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 45 deletions.
4 changes: 4 additions & 0 deletions dist/csvx.iife.js
Expand Up @@ -379,6 +379,10 @@ var CSVx = (function (exports) {
return false;
}

if (!filename.trim().length) {
filename = 'export';
}

if (options) {
this.setOptions(options);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/csvx.iife.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/csvx.js
Expand Up @@ -32,6 +32,9 @@ class Export {
if (!Is.object(data[0]) && !Is.json(data[0])) {
return false;
}
if (!filename.trim().length) {
filename = 'export';
}
if (options) {
this.setOptions(options);
}
Expand Down
28 changes: 14 additions & 14 deletions doc/classes/_convert_.convert.html
Expand Up @@ -114,7 +114,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> array</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L34">convert.ts:34</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L34">convert.ts:34</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -146,7 +146,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L92">convert.ts:92</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L92">convert.ts:92</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -175,7 +175,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> setCSS</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L30">convert.ts:30</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L30">convert.ts:30</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -198,7 +198,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L96">convert.ts:96</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L96">convert.ts:96</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -224,7 +224,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> set<wbr>Options</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L26">convert.ts:26</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L26">convert.ts:26</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -247,7 +247,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> table</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L63">convert.ts:63</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L63">convert.ts:63</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -278,7 +278,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> css</h3>
<div class="tsd-signature tsd-kind-icon">css<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L21">convert.ts:21</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L21">convert.ts:21</a></li>
</ul>
</aside>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
Expand All @@ -287,7 +287,7 @@ <h3>table</h3>
<div class="tsd-signature tsd-kind-icon">table<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> =&nbsp;&quot;&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L22">convert.ts:22</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L22">convert.ts:22</a></li>
</ul>
</aside>
</section>
Expand All @@ -297,7 +297,7 @@ <h3>th</h3>
<div class="tsd-signature tsd-kind-icon">th<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> =&nbsp;&quot;&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L23">convert.ts:23</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L23">convert.ts:23</a></li>
</ul>
</aside>
</section>
Expand All @@ -308,7 +308,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> options</h3>
<div class="tsd-signature tsd-kind-icon">options<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L12">convert.ts:12</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L12">convert.ts:12</a></li>
</ul>
</aside>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
Expand All @@ -317,7 +317,7 @@ <h3>CRLF</h3>
<div class="tsd-signature tsd-kind-icon">CRLF<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> =&nbsp;&quot;&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L18">convert.ts:18</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L18">convert.ts:18</a></li>
</ul>
</aside>
</section>
Expand All @@ -327,7 +327,7 @@ <h3>labels</h3>
<div class="tsd-signature tsd-kind-icon">labels<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol"> =&nbsp;true</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L15">convert.ts:15</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L15">convert.ts:15</a></li>
</ul>
</aside>
</section>
Expand All @@ -337,7 +337,7 @@ <h3>quote</h3>
<div class="tsd-signature tsd-kind-icon">quote<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> =&nbsp;&quot;&quot;&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L16">convert.ts:16</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L16">convert.ts:16</a></li>
</ul>
</aside>
</section>
Expand All @@ -347,7 +347,7 @@ <h3>separator</h3>
<div class="tsd-signature tsd-kind-icon">separator<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> =&nbsp;&quot;,&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/LCluber/CSVx.js/blob/d927801/src/ts/convert.ts#L17">convert.ts:17</a></li>
<li>Defined in <a href="https://github.com/estellepicq/CSVx.js/blob/1fd0abe/src/ts/convert.ts#L17">convert.ts:17</a></li>
</ul>
</aside>
</section>
Expand Down

0 comments on commit 4e0a1c0

Please sign in to comment.