Travis build: 698 [ci skip]
This commit is contained in:
75
README.md
75
README.md
@ -199,6 +199,7 @@
|
|||||||
* [`orderBy`](#orderby)
|
* [`orderBy`](#orderby)
|
||||||
* [`select`](#select)
|
* [`select`](#select)
|
||||||
* [`shallowClone`](#shallowclone)
|
* [`shallowClone`](#shallowclone)
|
||||||
|
* [`size`](#size)
|
||||||
* [`truthCheckCollection`](#truthcheckcollection)
|
* [`truthCheckCollection`](#truthcheckcollection)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@ -258,15 +259,6 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### _Uncategorized_
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>View contents</summary>
|
|
||||||
|
|
||||||
* [`size`](#size)
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
---
|
---
|
||||||
## 🔌 Adapter
|
## 🔌 Adapter
|
||||||
|
|
||||||
@ -3248,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).
|
||||||
@ -4305,37 +4331,6 @@ yesNo('Foo', true); // true
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
---
|
|
||||||
## _Uncategorized_
|
|
||||||
|
|
||||||
### 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
|
|
||||||
```
|
|
||||||
|
|
||||||
<br>[⬆ back to top](#table-of-contents)
|
|
||||||
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user