Skip to content

Commit e289076

Browse files
Reducing complexity and preparing v1.0.7
1 parent ceeb63e commit e289076

12 files changed

+676
-671
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
A fast, simple and powerful open-source utility tool for generating strong, unique and random passwords. Password Generator is free to use as a secure password generator on any computer, phone, or tablet.
66

77
[![Getting Started](https://raw.githubusercontent.com/sebastienrousseau/password-generator/master/assets/button-primary.svg)](#installation)
8-
[![Download the Password Generator Tool v1.0.6](https://raw.githubusercontent.com/sebastienrousseau/password-generator/master/assets/button-secondary.svg)](https://github.com/sebastienrousseau/password-generator/archive/refs/tags/1.0.6.zip)
8+
[![Download the Password Generator Tool v1.0.7](https://raw.githubusercontent.com/sebastienrousseau/password-generator/master/assets/button-secondary.svg)](https://github.com/sebastienrousseau/password-generator/archive/refs/tags/1.0.7.zip)
99

1010
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/0acb169c95e443729551979e0fd86eaf)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=sebastienrousseau/password-generator&utm_campaign=Badge_Grade)
1111
[![npm](https://img.shields.io/npm/v/@sebastienrousseau/password-generator.svg?style=flat&color=success)](https://www.npmjs.com/package/@sebastienrousseau/password-generator)

docs/global.html

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,68 @@ <h4 class="name" id="toCharArray"><span class="type-signature">(constant) </span
222222

223223

224224

225+
<h4 class="name" id="toCurrency"><span class="type-signature">(constant) </span>toCurrency<span class="type-signature"></span></h4>
226+
227+
228+
229+
230+
<div class="description">
231+
Takes a number and returns it in the specified currency formatting..
232+
</div>
233+
234+
235+
236+
237+
238+
239+
240+
<dl class="details">
241+
242+
243+
244+
245+
246+
247+
248+
249+
250+
251+
252+
253+
254+
255+
256+
257+
258+
259+
260+
261+
262+
263+
264+
265+
266+
267+
<dt class="tag-source">Source:</dt>
268+
<dd class="tag-source"><ul class="dummy"><li>
269+
<a href="toCurrency_toCurrency.js.html">toCurrency/toCurrency.js</a>, <a href="toCurrency_toCurrency.js.html#line6">line 6</a>
270+
</li></ul></dd>
271+
272+
273+
274+
275+
276+
277+
278+
</dl>
279+
280+
281+
282+
283+
284+
285+
286+
225287
<h4 class="name" id="toKebabCase"><span class="type-signature">(constant) </span>toKebabCase<span class="type-signature"></span></h4>
226288

227289

@@ -424,13 +486,13 @@ <h4 class="name" id="toTitleCase"><span class="type-signature">(constant) </span
424486
</div>
425487

426488
<nav>
427-
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
489+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toCurrency">toCurrency</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
428490
</nav>
429491

430492
<br class="clear">
431493

432494
<footer>
433-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 00:13:13 GMT+0100 (British Summer Time)
495+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 19:24:23 GMT+0100 (British Summer Time)
434496
</footer>
435497

436498
<script> prettyPrint(); </script>

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ <h3> </h3>
5050
</div>
5151

5252
<nav>
53-
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
53+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toCurrency">toCurrency</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
5454
</nav>
5555

5656
<br class="clear">
5757

5858
<footer>
59-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 00:13:14 GMT+0100 (British Summer Time)
59+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 19:24:23 GMT+0100 (British Summer Time)
6060
</footer>
6161

6262
<script> prettyPrint(); </script>

docs/toCamelCase_toCamelCase.js.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ <h1 class="page-title">Source: toCamelCase/toCamelCase.js</h1>
6262
</div>
6363

6464
<nav>
65-
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
65+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toCurrency">toCurrency</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
6666
</nav>
6767

6868
<br class="clear">
6969

7070
<footer>
71-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 00:13:13 GMT+0100 (British Summer Time)
71+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 19:24:23 GMT+0100 (British Summer Time)
7272
</footer>
7373

7474
<script> prettyPrint(); </script>

docs/toCharArray_toCharArray.js.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ <h1 class="page-title">Source: toCharArray/toCharArray.js</h1>
5252
</div>
5353

5454
<nav>
55-
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
55+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toCurrency">toCurrency</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
5656
</nav>
5757

5858
<br class="clear">
5959

6060
<footer>
61-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 00:13:13 GMT+0100 (British Summer Time)
61+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 19:24:23 GMT+0100 (British Summer Time)
6262
</footer>
6363

6464
<script> prettyPrint(); </script>

docs/toCurrency_toCurrency.js.html

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>JSDoc: Source: toCurrency/toCurrency.js</title>
6+
7+
<script src="scripts/prettify/prettify.js"> </script>
8+
<script src="scripts/prettify/lang-css.js"> </script>
9+
<!--[if lt IE 9]>
10+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11+
<![endif]-->
12+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14+
</head>
15+
16+
<body>
17+
18+
<div id="main">
19+
20+
<h1 class="page-title">Source: toCurrency/toCurrency.js</h1>
21+
22+
23+
24+
25+
26+
27+
<section>
28+
<article>
29+
<pre class="prettyprint source linenums"><code>/**
30+
* Takes a number and returns it in the specified currency formatting..
31+
* @param {String} str The text to be converted to kebab case.
32+
*/
33+
34+
export const toCurrency = (n, curr, LanguageFormat = undefined) =>
35+
Intl.NumberFormat(LanguageFormat, {
36+
style: "currency",
37+
minimumFractionDigits: 2,
38+
currency: curr,
39+
}).format(n);
40+
41+
// console.log(toCurrency(123456.789, 'EUR')); // ✔ should convert to €123,456.79 | currency: Euro | currencyLangFormat: Local
42+
// console.log(toCurrency(123456.789, 'RUB', 'Ru-ru')); // ✔ should convert to 123 456,79 ₽ | currency: Ruble | currencyLangFormat: Russian
43+
// console.log(toCurrency(123456.789, 'RUB')); // ✔ should convert to RUB 123,456.79 | currency: Ruble | currencyLangFormat: Local
44+
// console.log(toCurrency(123456.789, 'USD', 'en-us')); // ✔ should convert to $123,456.79 | currency: US Dollar | currencyLangFormat: English (United States)
45+
// console.log(toCurrency(123456.789, 'USD', 'fa')); // ✔ should convert to ۱۲۳٬۴۵۶٫۷۹ ؜$ | currency: US Dollar | currencyLangFormat: Farsi
46+
// console.log(toCurrency(322342436423.2435, "JPY", "fi")); // ✔ should convert to 322 342 436 423 ¥ | currency: Japanese Yen | currencyLangFormat: Finnish
47+
// console.log(toCurrency(322342436423.2435, "JPY")); // ✔ should convert to ¥322,342,436,423 | currency: Japanese Yen | currencyLangFormat: Local
48+
</code></pre>
49+
</article>
50+
</section>
51+
52+
53+
54+
55+
</div>
56+
57+
<nav>
58+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toCurrency">toCurrency</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
59+
</nav>
60+
61+
<br class="clear">
62+
63+
<footer>
64+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 19:24:23 GMT+0100 (British Summer Time)
65+
</footer>
66+
67+
<script> prettyPrint(); </script>
68+
<script src="scripts/linenumber.js"> </script>
69+
</body>
70+
</html>

docs/toKebabCase_toKebabCase.js.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ <h1 class="page-title">Source: toKebabCase/toKebabCase.js</h1>
5757
</div>
5858

5959
<nav>
60-
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
60+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toCurrency">toCurrency</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
6161
</nav>
6262

6363
<br class="clear">
6464

6565
<footer>
66-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 00:13:13 GMT+0100 (British Summer Time)
66+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 19:24:23 GMT+0100 (British Summer Time)
6767
</footer>
6868

6969
<script> prettyPrint(); </script>

docs/toSnakeCase_toSnakeCase.js.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ <h1 class="page-title">Source: toSnakeCase/toSnakeCase.js</h1>
5757
</div>
5858

5959
<nav>
60-
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
60+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toCurrency">toCurrency</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
6161
</nav>
6262

6363
<br class="clear">
6464

6565
<footer>
66-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 00:13:13 GMT+0100 (British Summer Time)
66+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 19:24:23 GMT+0100 (British Summer Time)
6767
</footer>
6868

6969
<script> prettyPrint(); </script>

docs/toTitleCase_toTitleCase.js.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ <h1 class="page-title">Source: toTitleCase/toTitleCase.js</h1>
5757
</div>
5858

5959
<nav>
60-
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
60+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#toCamelCase">toCamelCase</a></li><li><a href="global.html#toCharArray">toCharArray</a></li><li><a href="global.html#toCurrency">toCurrency</a></li><li><a href="global.html#toKebabCase">toKebabCase</a></li><li><a href="global.html#toSnakeCase">toSnakeCase</a></li><li><a href="global.html#toTitleCase">toTitleCase</a></li></ul>
6161
</nav>
6262

6363
<br class="clear">
6464

6565
<footer>
66-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 00:13:13 GMT+0100 (British Summer Time)
66+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 19:24:23 GMT+0100 (British Summer Time)
6767
</footer>
6868

6969
<script> prettyPrint(); </script>

index.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
#!/usr/bin/env node
22

3-
import { join } from "path";
43
import { program } from "commander";
5-
import { readFileSync } from "fs";
6-
7-
const { version } = JSON.parse(
8-
readFileSync(join(process.cwd(), "/package.json"), "utf8")
9-
);
104

115
program
12-
.version(version, "-v, --version", "output the current version")
13-
.option("-t, --type <type>", "Specify a password type")
6+
.version("1.0.7", "-v, --version", "output the current version")
7+
.option("-t, --type <type>", "specify a password type")
148
.option("-l, --length <numbers>", "specify a length for each iteration")
159
.option("-i, --iteration <numbers>", "specify a number of iteration")
1610
.option("-s, --separator <char>", "specify a character for the separator")

0 commit comments

Comments
 (0)