0.1.3 • Published 7 years ago

buildo-lodash-ts v0.1.3

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

DISCLAIMER: quick&dirty, temporary solution

lodash + typescript have a few problems when used together.

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

  1. Also, this doesn't work:
import pickByF = require('lodash/fp/pickByF') // no types for `lodash/fp`
  1. 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.

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago