🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

buildo-lodash-ts

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buildo-lodash-ts

`lodash` + `typescript` have a few problems when used together.

latest
Source
npmnpm
Version
0.1.3
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

DISCLAIMER: quick&dirty, temporary solution

lodash + typescript have a few problems when used together.

  • With the "official" @types/lodash typing, this doesn't work:
import pick from 'lodash/pick'

If you want to import granularly, you have to import pick = require('lodash/pick'), which is custom TS syntax.

  • Also, this doesn't work:
import pickByF = require('lodash/fp/pickByF') // no types for `lodash/fp`
  • In addition, many lodash functions have quite loose/funky apis, while in reality we use them in fairly standard/strict ways. Since most of the times having to account for many overrides produces a very loose final type for the consumer, it could be a good idea to stricten typings to match the subset of the api we use normally.

At the moment, this repo partially solves problem 1: in the final project we can import x from 'buildo-lodash-ts/lib/x without custom syntax.

For 2, we'll need to wait (or contribute) proper support.

For 3, this might be a good place to restrict types, but nothing is done at the moment.

We'll evaluate whether it makes sense to keep this repo or kill it (potentially updating an external library if you want to use a "new" lodash function might be too much of a burden) in the next few weeks.

FAQs

Package last updated on 21 Jun 2017

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