Socket
Socket
Sign inDemoInstall

lodash.omitby

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.omitby

The lodash method `_.omitBy` exported as a module.


Version published
Weekly downloads
315K
increased by0.45%
Maintainers
3
Weekly downloads
 
Created

What is lodash.omitby?

The lodash.omitby package is a utility function from the Lodash library that creates an object composed of the own and inherited enumerable string keyed properties of `object` that `predicate` doesn't return truthy for. Essentially, it allows you to omit properties from an object based on a condition.

What are lodash.omitby's main functionalities?

Omit properties based on a condition

This feature allows you to omit properties from an object where the values meet a certain condition. In this example, all properties with numeric values are omitted.

const omitBy = require('lodash.omitby');
const object = { 'a': 1, 'b': '2', 'c': 3 };
const result = omitBy(object, value => typeof value === 'number');
console.log(result); // { 'b': '2' }

Omit properties with null or undefined values

This feature allows you to omit properties from an object where the values are null or undefined. In this example, properties 'b' and 'c' are omitted.

const omitBy = require('lodash.omitby');
const object = { 'a': 1, 'b': null, 'c': undefined, 'd': 'text' };
const result = omitBy(object, value => value == null);
console.log(result); // { 'a': 1, 'd': 'text' }

Other packages similar to lodash.omitby

Keywords

FAQs

Package last updated on 13 Aug 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc