Merge branch 'patch-1' of https://github.com/kriadmin/30-seconds-of-code
This commit is contained in:
@ -4,14 +4,23 @@ setup_git() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
commit_website_files() {
|
commit_website_files() {
|
||||||
git checkout master
|
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then
|
||||||
git add *
|
if [ $TRAVIS_BRANCH == "master" ]; then
|
||||||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER"
|
echo "Commiting to master branch..."
|
||||||
|
git checkout master
|
||||||
|
git add *
|
||||||
|
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [ci skip]"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
upload_files() {
|
upload_files() {
|
||||||
echo "https://${GH_TOKEN}@github.com/Chalarangelo/30-seconds-of-code.git"
|
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then
|
||||||
git push --force "https://${GH_TOKEN}@github.com/Chalarangelo/30-seconds-of-code.git" master > /dev/null 2>&1
|
if [ $TRAVIS_BRANCH == "master" ]; then
|
||||||
|
echo "Pushing to master branch..."
|
||||||
|
git push --force --quiet "https://${GH_TOKEN}@github.com/Chalarangelo/30-seconds-of-code.git" master > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_git
|
setup_git
|
||||||
|
|||||||
271
README.md
271
README.md
@ -9,11 +9,13 @@
|
|||||||
- Use <kbd>Ctrl</kbd> + <kbd>F</kbd> or <kbd>command</kbd> + <kbd>F</kbd> to search for a snippet.
|
- Use <kbd>Ctrl</kbd> + <kbd>F</kbd> or <kbd>command</kbd> + <kbd>F</kbd> to search for a snippet.
|
||||||
- Contributions welcome, please read the [contribution guide](CONTRIBUTING.md).
|
- Contributions welcome, please read the [contribution guide](CONTRIBUTING.md).
|
||||||
- Snippets are written in ES6, use the [Babel transpiler](https://babeljs.io/) to ensure backwards-compatibility.
|
- Snippets are written in ES6, use the [Babel transpiler](https://babeljs.io/) to ensure backwards-compatibility.
|
||||||
|
- You can import these snippets into your text editor of choice (VSCode, Atom, Sublime) using the files found in [this repo](https://github.com/Rob-Rychs/30-seconds-of-code-texteditorsnippets).
|
||||||
- You can import these snippets into Alfred 3, using [this file](https://github.com/lslvxy/30-seconds-of-code-alfredsnippets).
|
- You can import these snippets into Alfred 3, using [this file](https://github.com/lslvxy/30-seconds-of-code-alfredsnippets).
|
||||||
|
- You can find a package with all the snippets on [npm](https://www.npmjs.com/package/tsoc). Bear in mind that most of these snippets are not production-ready.
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
### Adapter
|
### 🔌 Adapter
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
@ -27,7 +29,7 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Array
|
### 📚 Array
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
@ -75,13 +77,14 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Browser
|
### 🖥️ Browser
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
|
|
||||||
* [`arrayToHtmlList`](#arraytohtmllist)
|
* [`arrayToHtmlList`](#arraytohtmllist)
|
||||||
* [`bottomVisible`](#bottomvisible)
|
* [`bottomVisible`](#bottomvisible)
|
||||||
|
* [`copyToClipboard`](#copytoclipboard)
|
||||||
* [`currentURL`](#currenturl)
|
* [`currentURL`](#currenturl)
|
||||||
* [`detectDeviceType`](#detectdevicetype)
|
* [`detectDeviceType`](#detectdevicetype)
|
||||||
* [`elementIsVisibleInViewport`](#elementisvisibleinviewport)
|
* [`elementIsVisibleInViewport`](#elementisvisibleinviewport)
|
||||||
@ -96,12 +99,13 @@
|
|||||||
* [`scrollToTop`](#scrolltotop)
|
* [`scrollToTop`](#scrolltotop)
|
||||||
* [`setStyle`](#setstyle)
|
* [`setStyle`](#setstyle)
|
||||||
* [`show`](#show)
|
* [`show`](#show)
|
||||||
|
* [`speechSynthesis`](#speechsynthesis)
|
||||||
* [`toggleClass`](#toggleclass)
|
* [`toggleClass`](#toggleclass)
|
||||||
* [`UUIDGeneratorBrowser`](#uuidgeneratorbrowser)
|
* [`UUIDGeneratorBrowser`](#uuidgeneratorbrowser)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Date
|
### ⏱️ Date
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
@ -113,7 +117,7 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Function
|
### 🎛️ Function
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
@ -127,7 +131,7 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Logic
|
### 🔮 Logic
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
@ -136,7 +140,7 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Math
|
### ➗ Math
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
@ -172,16 +176,7 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Media
|
### 📦 Node
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>View contents</summary>
|
|
||||||
|
|
||||||
* [`speechSynthesis`](#speechsynthesis)
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### Node
|
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
@ -192,7 +187,7 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Object
|
### 🗃️ Object
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
@ -204,11 +199,12 @@
|
|||||||
* [`orderBy`](#orderby)
|
* [`orderBy`](#orderby)
|
||||||
* [`select`](#select)
|
* [`select`](#select)
|
||||||
* [`shallowClone`](#shallowclone)
|
* [`shallowClone`](#shallowclone)
|
||||||
|
* [`size`](#size)
|
||||||
* [`truthCheckCollection`](#truthcheckcollection)
|
* [`truthCheckCollection`](#truthcheckcollection)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### String
|
### 📜 String
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
@ -235,7 +231,7 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### Utility
|
### 💎 Utility
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
@ -248,6 +244,7 @@
|
|||||||
* [`isArray`](#isarray)
|
* [`isArray`](#isarray)
|
||||||
* [`isBoolean`](#isboolean)
|
* [`isBoolean`](#isboolean)
|
||||||
* [`isFunction`](#isfunction)
|
* [`isFunction`](#isfunction)
|
||||||
|
* [`isNull`](#isnull)
|
||||||
* [`isNumber`](#isnumber)
|
* [`isNumber`](#isnumber)
|
||||||
* [`isString`](#isstring)
|
* [`isString`](#isstring)
|
||||||
* [`isSymbol`](#issymbol)
|
* [`isSymbol`](#issymbol)
|
||||||
@ -258,10 +255,12 @@
|
|||||||
* [`toDecimalMark`](#todecimalmark)
|
* [`toDecimalMark`](#todecimalmark)
|
||||||
* [`toOrdinalSuffix`](#toordinalsuffix)
|
* [`toOrdinalSuffix`](#toordinalsuffix)
|
||||||
* [`validateNumber`](#validatenumber)
|
* [`validateNumber`](#validatenumber)
|
||||||
|
* [`yesNo`](#yesno)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## Adapter
|
---
|
||||||
|
## 🔌 Adapter
|
||||||
|
|
||||||
### call
|
### call
|
||||||
|
|
||||||
@ -423,7 +422,8 @@ arrayMax([1, 2, 4]); // 4
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
## Array
|
---
|
||||||
|
## 📚 Array
|
||||||
|
|
||||||
### chunk
|
### chunk
|
||||||
|
|
||||||
@ -1436,7 +1436,8 @@ zipObject(['a', 'b'], [1, 2, 3]); // {a: 1, b: 2}
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
## Browser
|
---
|
||||||
|
## 🖥️ Browser
|
||||||
|
|
||||||
### arrayToHtmlList
|
### arrayToHtmlList
|
||||||
|
|
||||||
@ -1485,6 +1486,48 @@ bottomVisible(); // true
|
|||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### copyToClipboard
|
||||||
|
|
||||||
|
Copy a string to the clipboard. Only works as a result of user action (i.e. inside a `click` event listener).
|
||||||
|
|
||||||
|
Create a new `<textarea>` element, fill it with the supplied data and add it to the HTML document.
|
||||||
|
Use `Selection.getRangeAt()`to store the selected range (if any).
|
||||||
|
Use `document.execCommand('copy')` to copy to the clipboard.
|
||||||
|
Remove the `<textarea>` element from the HTML document.
|
||||||
|
Finally, use `Selection().addRange()` to recover the original selected range (if any).
|
||||||
|
|
||||||
|
```js
|
||||||
|
const copyToClipboard = str => {
|
||||||
|
const el = document.createElement('textarea');
|
||||||
|
el.value = str;
|
||||||
|
el.setAttribute('readonly', '');
|
||||||
|
el.style.position = 'absolute';
|
||||||
|
el.style.left = '-9999px';
|
||||||
|
document.body.appendChild(el);
|
||||||
|
const selected =
|
||||||
|
document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;
|
||||||
|
el.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
document.body.removeChild(el);
|
||||||
|
if (selected) {
|
||||||
|
document.getSelection().removeAllRanges();
|
||||||
|
document.getSelection().addRange(selected);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
copyToClipboard('Lorem ipsum'); // 'Lorem ipsum' copied to clipboard.
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
### currentURL
|
### currentURL
|
||||||
|
|
||||||
Returns the current URL.
|
Returns the current URL.
|
||||||
@ -1841,6 +1884,35 @@ show(document.querySelectorAll('img')); // Shows all <img> elements on the page
|
|||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### speechSynthesis
|
||||||
|
|
||||||
|
Performs speech synthesis (experimental).
|
||||||
|
|
||||||
|
Use `SpeechSynthesisUtterance.voice` and `window.speechSynthesis.getVoices()` to convert a message to speech.
|
||||||
|
Use `window.speechSynthesis.speak()` to play the message.
|
||||||
|
|
||||||
|
Learn more about the [SpeechSynthesisUtterance interface of the Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance).
|
||||||
|
|
||||||
|
```js
|
||||||
|
const speechSynthesis = message => {
|
||||||
|
const msg = new SpeechSynthesisUtterance(message);
|
||||||
|
msg.voice = window.speechSynthesis.getVoices()[0];
|
||||||
|
window.speechSynthesis.speak(msg);
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
speechSynthesis('Hello, World'); // // plays the message
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
### toggleClass
|
### toggleClass
|
||||||
|
|
||||||
Toggle a class for an element.
|
Toggle a class for an element.
|
||||||
@ -1887,7 +1959,8 @@ UUIDGeneratorBrowser(); // '7982fcfe-5721-4632-bede-6000885be57d'
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
## Date
|
---
|
||||||
|
## ⏱️ Date
|
||||||
|
|
||||||
### getDaysDiffBetweenDates
|
### getDaysDiffBetweenDates
|
||||||
|
|
||||||
@ -1987,7 +2060,8 @@ tomorrow(); // 2017-12-27 (if current date is 2017-12-26)
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
## Function
|
---
|
||||||
|
## 🎛️ Function
|
||||||
|
|
||||||
### chainAsync
|
### chainAsync
|
||||||
|
|
||||||
@ -2150,7 +2224,8 @@ async function sleepyWork() {
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
## Logic
|
---
|
||||||
|
## 🔮 Logic
|
||||||
|
|
||||||
### negate
|
### negate
|
||||||
|
|
||||||
@ -2174,7 +2249,8 @@ negate(isOdd)(1); // false
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
## Math
|
---
|
||||||
|
## ➗ Math
|
||||||
|
|
||||||
### average
|
### average
|
||||||
|
|
||||||
@ -2397,7 +2473,7 @@ const fibonacciUntilNum = num => {
|
|||||||
<summary>Examples</summary>
|
<summary>Examples</summary>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
fibonacciCountUntilNum(10); // 7
|
fibonacciUntilNum(10); // [ 0, 1, 1, 2, 3, 5, 8 ]
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@ -2567,7 +2643,7 @@ Return `false` if any of them divides the given number, else return `true`, unle
|
|||||||
```js
|
```js
|
||||||
const isPrime = num => {
|
const isPrime = num => {
|
||||||
const boundary = Math.floor(Math.sqrt(num));
|
const boundary = Math.floor(Math.sqrt(num));
|
||||||
for (var i = 2; i * i <= boundary; i++) if (num % i == 0) return false;
|
for (var i = 2; i <= boundary; i++) if (num % i == 0) return false;
|
||||||
return num >= 2;
|
return num >= 2;
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
@ -2879,37 +2955,8 @@ sum([1, 2, 3, 4]); // 10
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
## Media
|
---
|
||||||
|
## 📦 Node
|
||||||
### speechSynthesis
|
|
||||||
|
|
||||||
Performs speech synthesis (experimental).
|
|
||||||
|
|
||||||
Use `SpeechSynthesisUtterance.voice` and `window.speechSynthesis.getVoices()` to convert a message to speech.
|
|
||||||
Use `window.speechSynthesis.speak()` to play the message.
|
|
||||||
|
|
||||||
Learn more about the [SpeechSynthesisUtterance interface of the Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance).
|
|
||||||
|
|
||||||
```js
|
|
||||||
const speechSynthesis = message => {
|
|
||||||
const msg = new SpeechSynthesisUtterance(message);
|
|
||||||
msg.voice = window.speechSynthesis.getVoices()[0];
|
|
||||||
window.speechSynthesis.speak(msg);
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Examples</summary>
|
|
||||||
|
|
||||||
```js
|
|
||||||
speechSynthesis('Hello, World'); // // plays the message
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
|
||||||
|
|
||||||
## Node
|
|
||||||
|
|
||||||
### JSONToFile
|
### JSONToFile
|
||||||
|
|
||||||
@ -2998,7 +3045,8 @@ UUIDGeneratorNode(); // '79c7c136-60ee-40a2-beb2-856f1feabefc'
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
## Object
|
---
|
||||||
|
## 🗃️ Object
|
||||||
|
|
||||||
### cleanObj
|
### cleanObj
|
||||||
|
|
||||||
@ -3192,6 +3240,40 @@ a === b; // false
|
|||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### size
|
||||||
|
|
||||||
|
Get size of arrays, objects or strings.
|
||||||
|
|
||||||
|
Get type of `value` (`array`, `object` or `string`).
|
||||||
|
Use `length` property for arrays.
|
||||||
|
Use `length` or `size` value if available or number of keys for objects.
|
||||||
|
Use `size` of a [`Blob` object](https://developer.mozilla.org/en-US/docs/Web/API/Blob) created from `value` for strings.
|
||||||
|
|
||||||
|
Split strings into array of characters with `split('')` and return its length.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const size = value =>
|
||||||
|
Array.isArray(value)
|
||||||
|
? value.length
|
||||||
|
: value && typeof value === 'object'
|
||||||
|
? value.size || value.length || Object.keys(value).length
|
||||||
|
: typeof value === 'string' ? new Blob([value]).size : 0;
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
size([1, 2, 3, 4, 5]); // 5
|
||||||
|
size('size'); // 4
|
||||||
|
size({ one: 1, two: 2, three: 3 }); // 3
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
### truthCheckCollection
|
### truthCheckCollection
|
||||||
|
|
||||||
Checks if the predicate (second argument) is truthy on all elements of a collection (first argument).
|
Checks if the predicate (second argument) is truthy on all elements of a collection (first argument).
|
||||||
@ -3213,7 +3295,8 @@ truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
## String
|
---
|
||||||
|
## 📜 String
|
||||||
|
|
||||||
### anagrams
|
### anagrams
|
||||||
|
|
||||||
@ -3632,13 +3715,12 @@ Break the string into words and combine them using `_` as a separator.
|
|||||||
For more detailed explanation of this Regex, [visit this Site](https://regex101.com/r/bMCgAB/1).
|
For more detailed explanation of this Regex, [visit this Site](https://regex101.com/r/bMCgAB/1).
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const toSnakeCase = str => {
|
const toSnakeCase = str =>
|
||||||
str &&
|
str &&
|
||||||
str
|
str
|
||||||
.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
|
.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
|
||||||
.map(x => x.toLowerCase())
|
.map(x => x.toLowerCase())
|
||||||
.join('_');
|
.join('_');
|
||||||
};
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@ -3737,7 +3819,8 @@ words('python, javaScript & coffee'); // ["python", "javaScript", "coffee"]
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
## Utility
|
---
|
||||||
|
## 💎 Utility
|
||||||
|
|
||||||
### coalesce
|
### coalesce
|
||||||
|
|
||||||
@ -3947,6 +4030,29 @@ isFunction(x => x); // true
|
|||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### isNull
|
||||||
|
|
||||||
|
Returns `true` if the specified value is `null`, `false` otherwise.
|
||||||
|
|
||||||
|
Use the strict equality operator to check if the value and of `val` are equal to `null`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const isNull = val => val === null;
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
isNull(null); // true
|
||||||
|
isNull('null'); // false
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
### isNumber
|
### isNumber
|
||||||
|
|
||||||
Checks if the given argument is a number.
|
Checks if the given argument is a number.
|
||||||
@ -4199,6 +4305,33 @@ validateNumber('10'); // true
|
|||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
|
### yesNo
|
||||||
|
|
||||||
|
Returns `true` if the string is `y`/`yes` or `false` if the string is `n`/`no`.
|
||||||
|
|
||||||
|
Use `RegExp.test()` to check if the string evaluates to `y/yes` or `n/no`.
|
||||||
|
Omit the second argument, `def` to set the default answer as `no`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const yesNo = (val, def = false) =>
|
||||||
|
/^(y|yes)$/i.test(val) ? true : /^(n|no)$/i.test(val) ? false : def;
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
yesNo('Y'); // true
|
||||||
|
yesNo('yes'); // true
|
||||||
|
yesNo('No'); // false
|
||||||
|
yesNo('Foo', true); // true
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
*Icons made by [Smashicons](https://www.flaticon.com/authors/smashicons) from [www.flaticon.com](https://www.flaticon.com/) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/).*
|
*Icons made by [Smashicons](https://www.flaticon.com/authors/smashicons) from [www.flaticon.com](https://www.flaticon.com/) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/).*
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
122
scripts/build.js
122
scripts/build.js
@ -3,51 +3,64 @@
|
|||||||
Run using `npm run builder`.
|
Run using `npm run builder`.
|
||||||
*/
|
*/
|
||||||
// Load modules
|
// Load modules
|
||||||
const fs = require('fs-extra'),
|
const fs = require('fs-extra');
|
||||||
path = require('path'),
|
const path = require('path');
|
||||||
chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
// Set variables for paths
|
|
||||||
const snippetsPath = './snippets',
|
const SNIPPETS_PATH = './snippets';
|
||||||
staticPartsPath = './static-parts';
|
const STATIC_PARTS_PATH = './static-parts';
|
||||||
// Set variables for script
|
|
||||||
let snippets = {},
|
const snippets = {};
|
||||||
startPart = '',
|
const EMOJIS = {
|
||||||
|
adapter: '🔌',
|
||||||
|
array: '📚',
|
||||||
|
browser: '🌐',
|
||||||
|
date: '⏱️',
|
||||||
|
function: '🎛️',
|
||||||
|
logic: '🔮',
|
||||||
|
math: '➗',
|
||||||
|
media: '📺',
|
||||||
|
node: '📦',
|
||||||
|
object: '🗃️',
|
||||||
|
string: '📜',
|
||||||
|
utility: '💎'
|
||||||
|
};
|
||||||
|
|
||||||
|
let startPart = '',
|
||||||
endPart = '',
|
endPart = '',
|
||||||
output = '',
|
output = '',
|
||||||
tagDbData = {};
|
tagDbData = {};
|
||||||
|
|
||||||
// Load helper functions (these are from existing snippets in 30 seconds of code!)
|
// Load helper functions (these are from existing snippets in 30 seconds of code!)
|
||||||
const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), {});
|
const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), {});
|
||||||
const capitalize = (str, lowerRest = false) =>
|
const capitalize = (str, lowerRest = false) =>
|
||||||
str.slice(0, 1).toUpperCase() + (lowerRest ? str.slice(1).toLowerCase() : str.slice(1));
|
str.slice(0, 1).toUpperCase() + (lowerRest ? str.slice(1).toLowerCase() : str.slice(1));
|
||||||
// Start the timer of the script
|
|
||||||
console.time('Builder');
|
console.time('Builder');
|
||||||
|
|
||||||
// Synchronously read all snippets and sort them as necessary (case-insensitive)
|
// Synchronously read all snippets and sort them as necessary (case-insensitive)
|
||||||
try {
|
try {
|
||||||
let snippetFilenames = fs.readdirSync(snippetsPath);
|
const snippetFilenames = fs
|
||||||
snippetFilenames.sort((a, b) => {
|
.readdirSync(SNIPPETS_PATH)
|
||||||
a = a.toLowerCase();
|
.sort((a, b) => a.toLowerCase() - b.toLowerCase());
|
||||||
b = b.toLowerCase();
|
|
||||||
if (a < b) return -1;
|
|
||||||
if (a > b) return 1;
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
// Store the data read from each snippet in the appropriate object
|
// Store the data read from each snippet in the appropriate object
|
||||||
for (let snippet of snippetFilenames)
|
for (const name of snippetFilenames) {
|
||||||
snippets[snippet] = fs.readFileSync(path.join(snippetsPath, snippet), 'utf8');
|
snippets[name] = fs.readFileSync(path.join(SNIPPETS_PATH, name), 'utf8');
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Handle errors (hopefully not!)
|
|
||||||
console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load static parts for the README file
|
// Load static parts for the README file
|
||||||
try {
|
try {
|
||||||
startPart = fs.readFileSync(path.join(staticPartsPath, 'README-start.md'), 'utf8');
|
startPart = fs.readFileSync(path.join(STATIC_PARTS_PATH, 'README-start.md'), 'utf8');
|
||||||
endPart = fs.readFileSync(path.join(staticPartsPath, 'README-end.md'), 'utf8');
|
endPart = fs.readFileSync(path.join(STATIC_PARTS_PATH, 'README-end.md'), 'utf8');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Handle errors (hopefully not!)
|
|
||||||
console.log(`${chalk.red('ERROR!')} During static part loading: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During static part loading: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load tag data from the database
|
// Load tag data from the database
|
||||||
try {
|
try {
|
||||||
tagDbData = objectFromPairs(
|
tagDbData = objectFromPairs(
|
||||||
@ -58,48 +71,62 @@ try {
|
|||||||
.map(v => v.split(':').slice(0, 2))
|
.map(v => v.split(':').slice(0, 2))
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Handle errors (hopefully not!)
|
|
||||||
console.log(`${chalk.red('ERROR!')} During tag database loading: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During tag database loading: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the output for the README file
|
// Create the output for the README file
|
||||||
try {
|
try {
|
||||||
|
const tags = [
|
||||||
|
...new Set(
|
||||||
|
Object.entries(tagDbData)
|
||||||
|
.map(t => t[1])
|
||||||
|
.filter(v => v)
|
||||||
|
.sort((a, b) => a.localeCompare(b))
|
||||||
|
)
|
||||||
|
];
|
||||||
|
|
||||||
// Add the start static part
|
// Add the start static part
|
||||||
output += `${startPart + '\n'}`;
|
output += `${startPart + '\n'}`;
|
||||||
// Loop over tags and snippets to create the table of contents
|
|
||||||
let uncategorizedOutput = '';
|
let uncategorizedOutput = '';
|
||||||
for (let tag of [...new Set(Object.entries(tagDbData).map(t => t[1]))]
|
|
||||||
.filter(v => v)
|
// Loop over tags and snippets to create the table of contents
|
||||||
.sort((a, b) => a.localeCompare(b))) {
|
for (const tag of tags) {
|
||||||
if (capitalize(tag, true) == 'Uncategorized') {
|
const capitalizedTag = capitalize(tag, true);
|
||||||
uncategorizedOutput += `### _${capitalize(
|
|
||||||
tag,
|
if (capitalizedTag === 'Uncategorized') {
|
||||||
true
|
uncategorizedOutput += `### _${capitalizedTag}_\n\n<details>\n<summary>View contents</summary>\n\n`;
|
||||||
)}_\n\n<details>\n<summary>View contents</summary>\n\n`;
|
for (const taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) {
|
||||||
for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag))
|
|
||||||
uncategorizedOutput += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()})\n`;
|
uncategorizedOutput += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()})\n`;
|
||||||
|
}
|
||||||
uncategorizedOutput += '\n</details>\n\n';
|
uncategorizedOutput += '\n</details>\n\n';
|
||||||
} else {
|
} else {
|
||||||
output += `### ${capitalize(tag, true)}\n\n<details>\n<summary>View contents</summary>\n\n`;
|
output += `### ${
|
||||||
for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag))
|
EMOJIS[tag] || ''
|
||||||
|
} ${capitalizedTag}\n\n<details>\n<summary>View contents</summary>\n\n`;
|
||||||
|
for (const taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) {
|
||||||
output += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()})\n`;
|
output += `* [\`${taggedSnippet[0]}\`](#${taggedSnippet[0].toLowerCase()})\n`;
|
||||||
|
}
|
||||||
output += '\n</details>\n\n';
|
output += '\n</details>\n\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output += uncategorizedOutput;
|
output += uncategorizedOutput;
|
||||||
uncategorizedOutput = '';
|
uncategorizedOutput = '';
|
||||||
|
|
||||||
// Loop over tags and snippets to create the list of snippets
|
// Loop over tags and snippets to create the list of snippets
|
||||||
for (let tag of [...new Set(Object.entries(tagDbData).map(t => t[1]))]
|
for (const tag of tags) {
|
||||||
.filter(v => v)
|
const capitalizedTag = capitalize(tag, true);
|
||||||
.sort((a, b) => a.localeCompare(b))) {
|
|
||||||
if (capitalize(tag, true) == 'Uncategorized') {
|
if (capitalizedTag == 'Uncategorized') {
|
||||||
uncategorizedOutput += `## _${capitalize(tag, true)}_\n`;
|
uncategorizedOutput += `---\n ## _${capitalizedTag}_\n`;
|
||||||
for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag))
|
for (const taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) {
|
||||||
uncategorizedOutput += `\n${snippets[taggedSnippet[0] + '.md'] +
|
uncategorizedOutput += `\n${snippets[taggedSnippet[0] + '.md'] +
|
||||||
'\n<br>[⬆ back to top](#table-of-contents)\n\n'}`;
|
'\n<br>[⬆ back to top](#table-of-contents)\n\n'}`;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
output += `## ${capitalize(tag, true)}\n`;
|
output += `---\n ## ${EMOJIS[tag] || ''} ${capitalizedTag}\n`;
|
||||||
for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) {
|
for (const taggedSnippet of Object.entries(tagDbData).filter(v => v[1] === tag)) {
|
||||||
let data = snippets[taggedSnippet[0] + '.md'];
|
let data = snippets[taggedSnippet[0] + '.md'];
|
||||||
data =
|
data =
|
||||||
data.slice(0, data.lastIndexOf('```js')) +
|
data.slice(0, data.lastIndexOf('```js')) +
|
||||||
@ -111,17 +138,16 @@ try {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output += uncategorizedOutput;
|
output += uncategorizedOutput;
|
||||||
// Add the ending static part
|
// Add the ending static part
|
||||||
output += `\n${endPart + '\n'}`;
|
output += `\n${endPart + '\n'}`;
|
||||||
// Write to the README file
|
// Write to the README file
|
||||||
fs.writeFileSync('README.md', output);
|
fs.writeFileSync('README.md', output);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Handle errors (hopefully not!)
|
|
||||||
console.log(`${chalk.red('ERROR!')} During README generation: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During README generation: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
// Log a success message
|
|
||||||
console.log(`${chalk.green('SUCCESS!')} README file generated!`);
|
console.log(`${chalk.green('SUCCESS!')} README file generated!`);
|
||||||
// Log the time taken
|
|
||||||
console.timeEnd('Builder');
|
console.timeEnd('Builder');
|
||||||
|
|||||||
33
snippets/copyToClipboard.md
Normal file
33
snippets/copyToClipboard.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
### copyToClipboard
|
||||||
|
|
||||||
|
Copy a string to the clipboard. Only works as a result of user action (i.e. inside a `click` event listener).
|
||||||
|
|
||||||
|
Create a new `<textarea>` element, fill it with the supplied data and add it to the HTML document.
|
||||||
|
Use `Selection.getRangeAt()`to store the selected range (if any).
|
||||||
|
Use `document.execCommand('copy')` to copy to the clipboard.
|
||||||
|
Remove the `<textarea>` element from the HTML document.
|
||||||
|
Finally, use `Selection().addRange()` to recover the original selected range (if any).
|
||||||
|
|
||||||
|
```js
|
||||||
|
const copyToClipboard = str => {
|
||||||
|
const el = document.createElement('textarea');
|
||||||
|
el.value = str;
|
||||||
|
el.setAttribute('readonly', '');
|
||||||
|
el.style.position = 'absolute';
|
||||||
|
el.style.left = '-9999px';
|
||||||
|
document.body.appendChild(el);
|
||||||
|
const selected =
|
||||||
|
document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;
|
||||||
|
el.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
document.body.removeChild(el);
|
||||||
|
if (selected) {
|
||||||
|
document.getSelection().removeAllRanges();
|
||||||
|
document.getSelection().addRange(selected);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
copyToClipboard('Lorem ipsum'); // 'Lorem ipsum' copied to clipboard.
|
||||||
|
```
|
||||||
@ -17,5 +17,5 @@ const fibonacciUntilNum = num => {
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
fibonacciCountUntilNum(10); // 7
|
fibonacciUntilNum(10); // [ 0, 1, 1, 2, 3, 5, 8 ]
|
||||||
```
|
```
|
||||||
|
|||||||
14
snippets/isNull.md
Normal file
14
snippets/isNull.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
### isNull
|
||||||
|
|
||||||
|
Returns `true` if the specified value is `null`, `false` otherwise.
|
||||||
|
|
||||||
|
Use the strict equality operator to check if the value and of `val` are equal to `null`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const isNull = val => val === null;
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
isNull(null); // true
|
||||||
|
isNull('null'); // false
|
||||||
|
```
|
||||||
@ -8,7 +8,7 @@ Return `false` if any of them divides the given number, else return `true`, unle
|
|||||||
```js
|
```js
|
||||||
const isPrime = num => {
|
const isPrime = num => {
|
||||||
const boundary = Math.floor(Math.sqrt(num));
|
const boundary = Math.floor(Math.sqrt(num));
|
||||||
for (var i = 2; i * i <= boundary; i++) if (num % i == 0) return false;
|
for (var i = 2; i <= boundary; i++) if (num % i == 0) return false;
|
||||||
return num >= 2;
|
return num >= 2;
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|||||||
25
snippets/size.md
Normal file
25
snippets/size.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
### size
|
||||||
|
|
||||||
|
Get size of arrays, objects or strings.
|
||||||
|
|
||||||
|
Get type of `value` (`array`, `object` or `string`).
|
||||||
|
Use `length` property for arrays.
|
||||||
|
Use `length` or `size` value if available or number of keys for objects.
|
||||||
|
Use `size` of a [`Blob` object](https://developer.mozilla.org/en-US/docs/Web/API/Blob) created from `value` for strings.
|
||||||
|
|
||||||
|
Split strings into array of characters with `split('')` and return its length.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const size = value =>
|
||||||
|
Array.isArray(value)
|
||||||
|
? value.length
|
||||||
|
: value && typeof value === 'object'
|
||||||
|
? value.size || value.length || Object.keys(value).length
|
||||||
|
: typeof value === 'string' ? new Blob([value]).size : 0;
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
size([1, 2, 3, 4, 5]); // 5
|
||||||
|
size('size'); // 4
|
||||||
|
size({ one: 1, two: 2, three: 3 }); // 3
|
||||||
|
```
|
||||||
@ -6,13 +6,12 @@ Break the string into words and combine them using `_` as a separator.
|
|||||||
For more detailed explanation of this Regex, [visit this Site](https://regex101.com/r/bMCgAB/1).
|
For more detailed explanation of this Regex, [visit this Site](https://regex101.com/r/bMCgAB/1).
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const toSnakeCase = str => {
|
const toSnakeCase = str =>
|
||||||
str &&
|
str &&
|
||||||
str
|
str
|
||||||
.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
|
.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
|
||||||
.map(x => x.toLowerCase())
|
.map(x => x.toLowerCase())
|
||||||
.join('_');
|
.join('_');
|
||||||
};
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
18
snippets/yesNo.md
Normal file
18
snippets/yesNo.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
### yesNo
|
||||||
|
|
||||||
|
Returns `true` if the string is `y`/`yes` or `false` if the string is `n`/`no`.
|
||||||
|
|
||||||
|
Use `RegExp.test()` to check if the string evaluates to `y/yes` or `n/no`.
|
||||||
|
Omit the second argument, `def` to set the default answer as `no`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const yesNo = (val, def = false) =>
|
||||||
|
/^(y|yes)$/i.test(val) ? true : /^(n|no)$/i.test(val) ? false : def;
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
yesNo('Y'); // true
|
||||||
|
yesNo('yes'); // true
|
||||||
|
yesNo('No'); // false
|
||||||
|
yesNo('Foo', true); // true
|
||||||
|
```
|
||||||
@ -9,6 +9,8 @@
|
|||||||
- Use <kbd>Ctrl</kbd> + <kbd>F</kbd> or <kbd>command</kbd> + <kbd>F</kbd> to search for a snippet.
|
- Use <kbd>Ctrl</kbd> + <kbd>F</kbd> or <kbd>command</kbd> + <kbd>F</kbd> to search for a snippet.
|
||||||
- Contributions welcome, please read the [contribution guide](CONTRIBUTING.md).
|
- Contributions welcome, please read the [contribution guide](CONTRIBUTING.md).
|
||||||
- Snippets are written in ES6, use the [Babel transpiler](https://babeljs.io/) to ensure backwards-compatibility.
|
- Snippets are written in ES6, use the [Babel transpiler](https://babeljs.io/) to ensure backwards-compatibility.
|
||||||
|
- You can import these snippets into your text editor of choice (VSCode, Atom, Sublime) using the files found in [this repo](https://github.com/Rob-Rychs/30-seconds-of-code-texteditorsnippets).
|
||||||
- You can import these snippets into Alfred 3, using [this file](https://github.com/lslvxy/30-seconds-of-code-alfredsnippets).
|
- You can import these snippets into Alfred 3, using [this file](https://github.com/lslvxy/30-seconds-of-code-alfredsnippets).
|
||||||
|
- You can find a package with all the snippets on [npm](https://www.npmjs.com/package/tsoc). Bear in mind that most of these snippets are not production-ready.
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|||||||
@ -16,6 +16,7 @@ collatz:math
|
|||||||
collectInto:adapter
|
collectInto:adapter
|
||||||
compact:array
|
compact:array
|
||||||
compose:function
|
compose:function
|
||||||
|
copyToClipboard:browser
|
||||||
countOccurrences:array
|
countOccurrences:array
|
||||||
countVowels:string
|
countVowels:string
|
||||||
currentURL:browser
|
currentURL:browser
|
||||||
@ -69,6 +70,7 @@ isBoolean:utility
|
|||||||
isDivisible:math
|
isDivisible:math
|
||||||
isEven:math
|
isEven:math
|
||||||
isFunction:utility
|
isFunction:utility
|
||||||
|
isNull:utility
|
||||||
isNumber:utility
|
isNumber:utility
|
||||||
isPrime:math
|
isPrime:math
|
||||||
isString:utility
|
isString:utility
|
||||||
@ -119,9 +121,10 @@ shallowClone:object
|
|||||||
show:browser
|
show:browser
|
||||||
shuffle:array
|
shuffle:array
|
||||||
similarity:array
|
similarity:array
|
||||||
|
size:object
|
||||||
sleep:function
|
sleep:function
|
||||||
sortCharactersInString:string
|
sortCharactersInString:string
|
||||||
speechSynthesis:media
|
speechSynthesis:browser
|
||||||
splitLines:string
|
splitLines:string
|
||||||
spreadOver:adapter
|
spreadOver:adapter
|
||||||
standardDeviation:math
|
standardDeviation:math
|
||||||
@ -148,5 +151,6 @@ UUIDGeneratorNode:node
|
|||||||
validateNumber:utility
|
validateNumber:utility
|
||||||
without:array
|
without:array
|
||||||
words:string
|
words:string
|
||||||
|
yesNo:utility
|
||||||
zip:array
|
zip:array
|
||||||
zipObject:array
|
zipObject:array
|
||||||
|
|||||||
Reference in New Issue
Block a user