Add documentation to the helpers module.
This commit is contained in:
@@ -78,9 +78,6 @@
|
||||
<li>
|
||||
<a href="#readCsv" title="src/app/_helpers/read-csv.ts"><b>readCsv</b> (src/.../read-csv.ts)</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#removeSpecialChar" title="src/app/_helpers/export-csv.ts"><b>removeSpecialChar</b> (src/.../export-csv.ts)</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#vcardValidation" title="src/app/_helpers/schema-validation.ts"><b>vcardValidation</b> (src/.../schema-validation.ts)</a>
|
||||
</li>
|
||||
@@ -117,6 +114,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Returns the sum of all values in an array.</p>
|
||||
</div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
@@ -125,6 +124,7 @@
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Optional</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -136,18 +136,34 @@
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<ul>
|
||||
<li>An array of numbers.</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<b>Example :</b>
|
||||
<div>
|
||||
<pre class="line-numbers"><code class="language-html">Prints 6 for the array [1, 2, 3]:</p>
|
||||
<p>```typescript</p>
|
||||
<ul>
|
||||
<li>console.log(arraySum([1, 2, 3]));</li>
|
||||
<li>```</li>
|
||||
</ul></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
|
||||
<p>The sum of all values in the array.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -179,6 +195,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Copies set text to clipboard.</p>
|
||||
</div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
@@ -188,6 +206,7 @@
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -202,18 +221,34 @@
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<ul>
|
||||
<li>The text to be copied to the clipboard.</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<b>Example :</b>
|
||||
<div>
|
||||
<pre class="line-numbers"><code class="language-html">copies &#39;Hello World!&#39; to the clipboard and prints &quot;true&quot;:</p>
|
||||
<p>```typescript</p>
|
||||
<ul>
|
||||
<li>console.log(copyToClipboard(&#39;Hello World!&#39;));</li>
|
||||
<li>```</li>
|
||||
</ul></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
|
||||
<p>true - If the copy operation is successful.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -245,6 +280,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Exports data to a CSV format and provides a download file.</p>
|
||||
</div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
@@ -253,6 +290,7 @@
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Optional</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -264,6 +302,12 @@
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<ul>
|
||||
<li>An array of data to be converted to CSV format.</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>filename</td>
|
||||
@@ -273,6 +317,12 @@
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<ul>
|
||||
<li>The name of the file to be downloaded.</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>delimiter</td>
|
||||
@@ -282,6 +332,13 @@
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<ul>
|
||||
<li>The delimiter to be used when converting to CSV format.
|
||||
Defaults to commas.</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -294,66 +351,6 @@
|
||||
</div>
|
||||
<div class="io-description">
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="removeSpecialChar"></a>
|
||||
<span class="name">
|
||||
<b>
|
||||
removeSpecialChar
|
||||
</b>
|
||||
<a href="#removeSpecialChar"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>removeSpecialChar(str)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>str</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -385,6 +382,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Provides an avenue of fetching resources via HTTP calls. </p>
|
||||
</div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
||||
@@ -420,6 +419,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Parses data to CSV format.</p>
|
||||
</div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
@@ -429,6 +430,7 @@
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -443,6 +445,12 @@
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<ul>
|
||||
<li>The data to be parsed.</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -454,7 +462,8 @@
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
|
||||
<p>An array of the parsed data.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -484,6 +493,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Reads a csv file and converts it to an array.</p>
|
||||
</div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
@@ -493,6 +504,7 @@
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -507,6 +519,12 @@
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<ul>
|
||||
<li>The file to be read.</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -518,7 +536,8 @@
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
|
||||
<p>An array of the read data.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -550,6 +569,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Validates a person object against the defined Person schema.</p>
|
||||
</div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
@@ -559,6 +580,7 @@
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -573,6 +595,12 @@
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<ul>
|
||||
<li>A person object to be validated.</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -614,6 +642,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Validates a vcard object against the defined Vcard schema.</p>
|
||||
</div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
@@ -623,6 +653,7 @@
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -637,6 +668,12 @@
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<ul>
|
||||
<li>A vcard object to be validated.</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user