TypeScript code (from https://lodash.com/docs#chain):
var users = [
{ 'user': 'barney', 'age': 36 },
{ 'user': 'fred', 'age': 40 },
{ 'user': 'pebbles', 'age': 1 }
];
var youngest = _.chain(users)
.sortBy('age')
.map(function(chr) {
return chr.user + ' is ' + chr.age;
})
.first()
.value();
tsc compiler complaints:
error TS2339: Property 'sortBy' does not exist on type 'LoDashExplicitArrayWrapper<{ 'user': string; 'age': number; }>'.
the same happens with pluck
Yep, I work on it and if you write which of methods are interesting for you, I'll add them first.
by #6600 :+1:
error TS2339: Property 'first' does not exist on type 'LoDashExplicitArrayWrapper<string>'.
@joe-chung yep, there are some problems in the module definition and they make difficult adding of signatures first
(and some other methods) right now
Property 'some' does not exist on type 'LodashArrayWrapper<any[]>'
@thakursagar The interface LodashArrayWrapper
does not exist in the definition of lodash
for a long time. Please check that you use the latest version of the definition. The method some
already should work fine.
Do you want me to submit a PR for _.reduce in the LoDashExplicitArrayWrapper ? This would be helpful for us
@gamebox Yeah, please add _.reduce, it's definitely missing.
need _.uniqBy
as well
also _.flattenDepth()
and _.sort
and _.split
_.flatMap
please
@chrootsu _.update
and _.updateWith
please :)
Property 'mean' does not exist on type 'LoDashStatic'.
Please add _(x).split
Same issue: Property 'split' does not exist on type 'LoDashExplicitWrapper<string>'
lodash version: 3.10.1
typings.json dependency:
"lodash": "registry:dt/lodash#3.10.0+20160802150749"
_.keyBy
seems to be missing as well
_.findWhere is also missing. Can you please add this aswell...
as is _.assign
_.flatMapDeep please? :)
_.max on LoDashExplicitArrayWrapper
interface LoDashExplicitArrayWrapper
/**
* @see _.max
*/
max(
iteratee: ListIterator
): LoDashExplicitWrapper
/**
* @see _.max
*/
max(iteratee: string): LoDashExplicitWrapper<number>;
/**
* @see _.max
*/
max(): LoDashExplicitWrapper<number>;
/**
* @see _.max
*/
max(iteratee: Dictionary<{}>): LoDashExplicitWrapper<number>;
}
Not sure why this is closed...there seems to be a bunch of methods missing from the typings (_.uniqWith
for me)
and _.find
on both
Property 'find' does not exist on type 'LoDashExplicitObjectWrapper<{}>'.
and
Property 'find' does not exist on type 'LoDashExplicitArrayWrapper<{}[]>'
and _.pairs
Property 'pairs' does not exist on type 'LoDashStatic'.
_.include as well
_.divide too
whatever goes after _.chain would have this error, plz help to fix it @chrootsu @rbcasperson
_.map also...
This issue should be reopened.
I checked the comments above, and these appear to be still missing:
_.divide();
_.include();
_.pairs();
This bug should be reopened as a lot of methods (mentioned above) still do not have correct typings.
Also transform is missing too,
reported separately by someone else here #14748
is this going to be fixed soon?
is there a work around?
A workaround may be like this:
(lodash.chain(stuff).pickBy(lodash.isArray) as any).transform(transformFunction, []).value();
_.mapValues() does not exist on UnderscoreStatic. This method is missing from lodash Kindly update.
it seems that _mapValues is not include in the chain but working as stand alone
Property 'keys' does not exist on type 'LoDashImplicitArrayWrapper
Property 'length' is missing in type 'LoDashImplicitArrayWrapper<...>'
Property 'differenceWith' does not exist on type 'LoDashImplicitObjectWrapper
Please ensure that you call https://lodash.com/docs/#prototype-value on the end of your chain
_.times please
_.partition please
_.cond Please
_.next also please
_.upperCase and _.deburr please
chain(blabla).mapValues()......
result on tslint error
Property 'mapValues' does not exist on type 'LoDashExplicitObjectWrapper<{}>'.
Opps... missing method does not exist in lodash.
This almost works, but .pickBy is also subject to this problem!
(lodash.chain(stuff).pickBy(lodash.isArray) as any).transform(transformFunction, []).value();
_.uniqWith please
Is there are any way we can fix this ourselves?
This thread is a few years old and there are still functions that do not work!
@charlesr1971 I have the issue with _.uniqWith
too, it seems that the function still works but the interface is not defined it yet.
Most helpful comment
A workaround may be like this: