Socket
Socket
Sign inDemoInstall

@types/lodash

Package Overview
Dependencies
0
Maintainers
1
Versions
197
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

@types/lodash

TypeScript definitions for lodash

    4.14.202ts4.5ts4.6ts4.7ts4.8ts4.9ts5.0ts5.1ts5.2ts5.3ts5.4latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
21,202,367
increased by8.31%

Weekly downloads

Package description

What is @types/lodash?

The @types/lodash package provides TypeScript type definitions for Lodash, a modern JavaScript utility library delivering modularity, performance, & extras. This allows developers to use Lodash in TypeScript projects with type checking and autocompletion features.

What are @types/lodash's main functionalities?

Array manipulation

Lodash provides a wide range of functions to manipulate arrays. The example demonstrates reversing an array.

import _ from 'lodash';

const array = [1, 2, 3, 4, 5];
const reversedArray = _.reverse(array);
console.log(reversedArray); // [5, 4, 3, 2, 1]

Object manipulation

Lodash allows for easy manipulation of objects, such as inverting keys and values in an object.

import _ from 'lodash';

const object = { 'a': 1, 'b': 2 };
const invertedObject = _.invert(object);
console.log(invertedObject); // { '1': 'a', '2': 'b' }

Collection iteration

Lodash provides functions like _.filter for iterating over collections and filtering them based on a condition.

import _ from 'lodash';

const users = [
  { 'user': 'barney', 'age': 36, 'active': true },
  { 'user': 'fred',   'age': 40, 'active': false }
];

const activeUsers = _.filter(users, (user) => user.active);
console.log(activeUsers); // [{ 'user': 'barney', 'age': 36, 'active': true }]

Other packages similar to @types/lodash

Readme

Source

Installation

npm install --save @types/lodash

Summary

This package contains type definitions for lodash (https://lodash.com).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash.

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: none

Credits

These definitions were written by Brian Zengel, Ilya Mochalov, AJ Richardson, e-cloud, Georgii Dolzhykov, Jack Moore, Dominique Rau, and William Chelman.

FAQs

Last updated on 21 Nov 2023

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc