Travis build: 468
This commit is contained in:
82
README.md
82
README.md
@ -100,6 +100,7 @@
|
||||
* [`setStyle`](#setstyle)
|
||||
* [`show`](#show)
|
||||
* [`toggleClass`](#toggleclass)
|
||||
* [`UUIDGeneratorBrowser`](#uuidgeneratorbrowser)
|
||||
|
||||
</details>
|
||||
|
||||
@ -189,6 +190,7 @@
|
||||
|
||||
* [`JSONToFile`](#jsontofile)
|
||||
* [`readFileLines`](#readfilelines)
|
||||
* [`UUIDGeneratorNode`](#uuidgeneratornode)
|
||||
|
||||
</details>
|
||||
|
||||
@ -251,7 +253,6 @@
|
||||
* [`timeTaken`](#timetaken)
|
||||
* [`toDecimalMark`](#todecimalmark)
|
||||
* [`toOrdinalSuffix`](#toordinalsuffix)
|
||||
* [`UUIDGenerator`](#uuidgenerator)
|
||||
* [`validateNumber`](#validatenumber)
|
||||
|
||||
</details>
|
||||
@ -1979,6 +1980,32 @@ toggleClass(document.querySelector('p.special'), 'special'); // The paragraph wi
|
||||
</details>
|
||||
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### UUIDGeneratorBrowser
|
||||
|
||||
Generates a UUID in a browser.
|
||||
|
||||
Use `crypto` API to generate a UUID, compliant with [RFC4122](https://www.ietf.org/rfc/rfc4122.txt) version 4.
|
||||
|
||||
```js
|
||||
const UUIDGeneratorBrowser = () =>
|
||||
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
|
||||
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
|
||||
);
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
UUIDGeneratorBrowser(); // '7982fcfe-5721-4632-bede-6000885be57d'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
## Date
|
||||
@ -3083,6 +3110,33 @@ console.log(arr); // ['line1', 'line2', 'line3']
|
||||
</details>
|
||||
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### UUIDGeneratorNode
|
||||
|
||||
Generates a UUID in Node.JS.
|
||||
|
||||
Use `crypto` API to generate a UUID, compliant with [RFC4122](https://www.ietf.org/rfc/rfc4122.txt) version 4.
|
||||
|
||||
```js
|
||||
const crypto = require('crypto');
|
||||
const UUIDGeneratorNode = () =>
|
||||
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
|
||||
(c ^ (crypto.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
|
||||
);
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
UUIDGeneratorNode(); // '79c7c136-60ee-40a2-beb2-856f1feabefc'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
## Object
|
||||
@ -4130,32 +4184,6 @@ toOrdinalSuffix('123'); // "123rd"
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### UUIDGenerator
|
||||
|
||||
Generates a UUID.
|
||||
|
||||
Use `crypto` API to generate a UUID, compliant with [RFC4122](https://www.ietf.org/rfc/rfc4122.txt) version 4.
|
||||
|
||||
```js
|
||||
const UUIDGenerator = () =>
|
||||
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
|
||||
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
|
||||
);
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
UUIDGenerator(); // '7982fcfe-5721-4632-bede-6000885be57d'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### validateNumber
|
||||
|
||||
Returns `true` if the given value is a number, `false` otherwise.
|
||||
|
||||
@ -169,6 +169,7 @@
|
||||
<a class="sublink-1" href="#setstyle">setStyle</a>
|
||||
<a class="sublink-1" href="#show">show</a>
|
||||
<a class="sublink-1" href="#toggleclass">toggleClass</a>
|
||||
<a class="sublink-1" href="#uuidgeneratorbrowser">UUIDGeneratorBrowser</a>
|
||||
|
||||
<h3>Date
|
||||
</h3><a class="sublink-1" href="#getdaysdiffbetweendates">getDaysDiffBetweenDates</a>
|
||||
@ -222,6 +223,7 @@
|
||||
<h3>Node
|
||||
</h3><a class="sublink-1" href="#jsontofile">JSONToFile</a>
|
||||
<a class="sublink-1" href="#readfilelines">readFileLines</a>
|
||||
<a class="sublink-1" href="#uuidgeneratornode">UUIDGeneratorNode</a>
|
||||
|
||||
<h3>Object
|
||||
</h3><a class="sublink-1" href="#cleanobj">cleanObj</a>
|
||||
@ -266,7 +268,6 @@
|
||||
<a class="sublink-1" href="#timetaken">timeTaken</a>
|
||||
<a class="sublink-1" href="#todecimalmark">toDecimalMark</a>
|
||||
<a class="sublink-1" href="#toordinalsuffix">toOrdinalSuffix</a>
|
||||
<a class="sublink-1" href="#uuidgenerator">UUIDGenerator</a>
|
||||
<a class="sublink-1" href="#validatenumber">validateNumber</a>
|
||||
|
||||
</nav><main class="col-sm-12 col-md-8 col-lg-9" style="height:100%;overflow-y:auto;background:#eceef2;padding:0"><a id="top"> </a><h2 style="text-align:center">Adapter</h2>
|
||||
@ -937,6 +938,16 @@ Scroll by a fraction of the distance from the top. Use <code>window.requestAnima
|
||||
</code></pre>
|
||||
<pre><code class="language-js">toggleClass(document.querySelector('p.special'), 'special'); // The paragraph will not have the 'special' class anymore
|
||||
</code></pre>
|
||||
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="uuidgeneratorbrowser">UUIDGeneratorBrowser</h3></div><div class="section double-padded">
|
||||
<p>Generates a UUID in a browser.</p>
|
||||
<p>Use <code>crypto</code> API to generate a UUID, compliant with <a href="https://www.ietf.org/rfc/rfc4122.txt">RFC4122</a> version 4.</p>
|
||||
<pre><code class="language-js">const UUIDGeneratorBrowser = () =>
|
||||
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
|
||||
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
|
||||
);
|
||||
</code></pre>
|
||||
<pre><code class="language-js">UUIDGeneratorBrowser(); // '7982fcfe-5721-4632-bede-6000885be57d'
|
||||
</code></pre>
|
||||
</div></div><br/><h2 style="text-align:center">Date</h2>
|
||||
<div class="card fluid"><div class="section double-padded"><h3 id="getdaysdiffbetweendates">getDaysDiffBetweenDates</h3></div><div class="section double-padded">
|
||||
<p>Returns the difference (in days) between two dates.</p>
|
||||
@ -1384,6 +1395,17 @@ contents of test.txt :
|
||||
let arr = readFileLines('test.txt');
|
||||
console.log(arr); // ['line1', 'line2', 'line3']
|
||||
</code></pre>
|
||||
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="uuidgeneratornode">UUIDGeneratorNode</h3></div><div class="section double-padded">
|
||||
<p>Generates a UUID in Node.JS.</p>
|
||||
<p>Use <code>crypto</code> API to generate a UUID, compliant with <a href="https://www.ietf.org/rfc/rfc4122.txt">RFC4122</a> version 4.</p>
|
||||
<pre><code class="language-js">const crypto = require('crypto');
|
||||
const UUIDGeneratorNode = () =>
|
||||
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
|
||||
(c ^ (crypto.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
|
||||
);
|
||||
</code></pre>
|
||||
<pre><code class="language-js">UUIDGeneratorNode(); // '79c7c136-60ee-40a2-beb2-856f1feabefc'
|
||||
</code></pre>
|
||||
</div></div><br/><h2 style="text-align:center">Object</h2>
|
||||
<div class="card fluid"><div class="section double-padded"><h3 id="cleanobj">cleanObj</h3></div><div class="section double-padded">
|
||||
<p>Removes any properties except the ones specified from a JSON object.</p>
|
||||
@ -1823,16 +1845,6 @@ If digit is found in teens pattern, use teens ordinal.</p>
|
||||
</code></pre>
|
||||
<pre><code class="language-js">toOrdinalSuffix('123'); // "123rd"
|
||||
</code></pre>
|
||||
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="uuidgenerator">UUIDGenerator</h3></div><div class="section double-padded">
|
||||
<p>Generates a UUID.</p>
|
||||
<p>Use <code>crypto</code> API to generate a UUID, compliant with <a href="https://www.ietf.org/rfc/rfc4122.txt">RFC4122</a> version 4.</p>
|
||||
<pre><code class="language-js">const UUIDGenerator = () =>
|
||||
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
|
||||
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
|
||||
);
|
||||
</code></pre>
|
||||
<pre><code class="language-js">UUIDGenerator(); // '7982fcfe-5721-4632-bede-6000885be57d'
|
||||
</code></pre>
|
||||
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="validatenumber">validateNumber</h3></div><div class="section double-padded">
|
||||
<p>Returns <code>true</code> if the given value is a number, <code>false</code> otherwise.</p>
|
||||
<p>Use <code>!isNaN</code> in combination with <code>parseFloat()</code> to check if the argument is a number.
|
||||
|
||||
@ -5,7 +5,7 @@ Generates a UUID in Node.JS.
|
||||
Use `crypto` API to generate a UUID, compliant with [RFC4122](https://www.ietf.org/rfc/rfc4122.txt) version 4.
|
||||
|
||||
```js
|
||||
const crypto = require("crypto");
|
||||
const crypto = require('crypto');
|
||||
const UUIDGeneratorNode = () =>
|
||||
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
|
||||
(c ^ (crypto.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
|
||||
|
||||
Reference in New Issue
Block a user