Index

src/app/_helpers/array-sum.ts

arraySum
arraySum(arr)

Returns the sum of all values in an array.

Parameters :
Name Optional Description
arr No
  • An array of numbers.
Example :
Prints 6 for the array [1, 2, 3]:</p>
<p>```typescript</p>
<ul>
<li>console.log(arraySum([1, 2, 3]));</li>
<li>```</li>
</ul>
Returns : number

The sum of all values in the array.

src/app/_helpers/clipboard-copy.ts

copyToClipboard
copyToClipboard(text: any)

Copies set text to clipboard.

Parameters :
Name Type Optional Description
text any No
  • The text to be copied to the clipboard.
Example :
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>
Returns : boolean

true - If the copy operation is successful.

src/app/_helpers/export-csv.ts

exportCsv
exportCsv(arrayData, filename, delimiter)

Exports data to a CSV format and provides a download file.

Parameters :
Name Optional Description
arrayData No
  • An array of data to be converted to CSV format.
filename No
  • The name of the file to be downloaded.
delimiter No
  • The delimiter to be used when converting to CSV format. Defaults to commas.
Returns : void

src/app/_helpers/http-getter.ts

HttpGetter
HttpGetter()

Provides an avenue of fetching resources via HTTP calls.

Returns : void

src/app/_helpers/read-csv.ts

parseData
parseData(data: any)

Parses data to CSV format.

Parameters :
Name Type Optional Description
data any No
  • The data to be parsed.
Returns : Array<any>

An array of the parsed data.

readCsv
readCsv(input: any)

Reads a csv file and converts it to an array.

Parameters :
Name Type Optional Description
input any No
  • The file to be read.
Returns : Array | void

An array of the read data.

src/app/_helpers/schema-validation.ts

personValidation
personValidation(person: any)

Validates a person object against the defined Person schema.

Parameters :
Name Type Optional Description
person any No
  • A person object to be validated.
Returns : Promise<void>
vcardValidation
vcardValidation(vcard: any)

Validates a vcard object against the defined Vcard schema.

Parameters :
Name Type Optional Description
vcard any No
  • A vcard object to be validated.
Returns : Promise<void>

result-matching ""

    No results matching ""