Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/outofsyncstudios/lodash-ex
[DEPRECATED] Pragmatic utility extensions for Lodash
https://github.com/outofsyncstudios/lodash-ex
Last synced: about 2 months ago
JSON representation
[DEPRECATED] Pragmatic utility extensions for Lodash
- Host: GitHub
- URL: https://github.com/outofsyncstudios/lodash-ex
- Owner: OutOfSyncStudios
- License: mit
- Created: 2018-01-19T19:55:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T18:31:39.000Z (about 2 years ago)
- Last Synced: 2024-10-02T08:30:05.438Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 677 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lodash-ex
[![NPM](https://nodei.co/npm/@outofsync/lodash-ex.png?downloads=true)](https://nodei.co/npm/@outofsync/lodash-ex/)
[![Actual version published on npm](http://img.shields.io/npm/v/@outofsync/lodash-ex.svg)](https://www.npmjs.org/package/@outofsync/lodash-ex)
[![Travis build status](https://travis-ci.org/OutOfSyncStudios/lodash-ex.svg)](https://www.npmjs.org/package/@outofsync/lodash-ex)
[![Total npm module downloads](http://img.shields.io/npm/dt/@outofsync/lodash-ex.svg)](https://www.npmjs.org/package/@outofsync/lodash-ex)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e60352058157440f8daf9135749f0f51)](https://www.codacy.com/app/OutOfSyncStudios/lodash-ex?utm_source=github.com&utm_medium=referral&utm_content=OutOfSyncStudios/lodash-ex&utm_campaign=Badge_Grade)
[![Codacy Coverage Badge](https://api.codacy.com/project/badge/Coverage/e60352058157440f8daf9135749f0f51)](https://www.codacy.com/app/OutOfSyncStudios/lodash-ex?utm_source=github.com&utm_medium=referral&utm_content=OutOfSyncStudios/lodash-ex&utm_campaign=Badge_Coverage)
[![Dependencies badge](https://david-dm.org/OutOfSyncStudios/lodash-ex/status.svg)](https://david-dm.org/OutOfSyncStudios/lodash-ex?view=list)Simple and useful utility extensions for Lodash.
# [Installation](#installation)```shell
npm install @outofsync/lodash-ex
```
# [Usage](#usage)
lodash-ex replaces and extends lodash, so it only the lodash-ex module needs to be included in your code:```js
const _ = require('@outofsync/lodash-ex');const data = { a: 'a', b: 'b' };
// Use lodash as you normally would
console.log(_.pick(data, ['a']);
```## _.isUnset(value) ⟾ boolean
Tests if the value provided is `null` or `undefined````js
_.isUnset(null);
_.isUnset(undefined);
_.isUnset(false);
```**Results**:
```
true
true
false
```## _.hasValue(value) ⟾ boolean
Tests if the value provided is not `null` or `undefined````js
_.hasValue(null);
_.hasValue(undefined);
_.hasValue(false);
```**Results**:
```
false
false
true
```## _.implies(a, b) ⟾ boolean
Test the logic imply operation a => b, providing the following truth table:| A | B | Result |
| - | - | ------ |
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |## _.bool(value) ⟾ boolean
Coerces the `value` provided to a boolean value.```js
_.bool(false);
_.bool(0);
_.bool(0.0);
_.bool('');
_.bool(null);
_.bool(undefined);
_.bool(true);
_.bool(1);
_.bool(3.14);
_.bool('abcd');
_.bool([]);
_.bool({});
_.bool(() => {}));
```**Results**:
```
false
false
false
false
false
false
true
true
true
true
true
true
true
```Copyright (c) 2018,2019 Out of Sync Studios LLC -- Licensed under the MIT license.