Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@outofsync/lodash-ex

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@outofsync/lodash-ex

Pragmatic utility extensions for Lodash

latest
Source
npmnpm
Version
1.3.2
Version published
Weekly downloads
249
-50.3%
Maintainers
1
Weekly downloads
 
Created
Source

lodash-ex

NPM

Actual version published on npm Travis build status Total npm module downloads Codacy Badge Codacy Coverage Badge Dependencies badge

Simple and useful utility extensions for Lodash.

Installation

  npm install @outofsync/lodash-ex

Usage

lodash-ex replaces and extends lodash, so it only the lodash-ex module needs to be included in your code:

  const _ = require('@outofsync/lodash-ex');

  const data = { a: 'a', b: 'b' };
  // Use lodash as you normally would
  console.log(_.pick(data, ['a']);

API Reference

_.isUnset(value) ⟾ boolean

Tests if the value provided is null or undefined

  _.isUnset(null);
  _.isUnset(undefined);
  _.isUnset(false);

Results:

  true
  true
  false

_.hasValue(value) ⟾ boolean

Tests if the value provided is not null or undefined

  _.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:

ABResult
TTT
TFF
FTT
FFT

_.bool(value) ⟾ boolean

Coerces the value provided to a boolean value.

  _.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

License

Copyright (c) 2018,2019 Jay Reardon -- Licensed under the MIT license.

Keywords

lodash

FAQs

Package last updated on 30 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts