0.1.3 • Published 7 years ago
buildo-lodash-ts v0.1.3
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.