-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Closed
Description
If you know how to fix the issue, make a pull request instead.
- I tried using the
@types/lodashpackage and had problems. - I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
- I'm using Typescript 2.3.4 (latest dependency available for my Angular project)
- I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
- Mention the authors (see
Definitions by:inindex.d.ts) so they can respond.
I have a couple of different classes that use the same semantic property name. Prior to the 4.14.78 release, I could do the following:
class A {
constructor(myName) {
this.name = myName;
}
}
class B {
constructor(myName, age) {
this.name = myName;
this.age = age;
}
}
let a1 = new A('a1');
let a2 = new A('a2');
let b1 = new B('a1', 30);
let diff = _.differenceBy([a1, a2], [b1], 'name');
// result: [{name: a2}]
Now, the type definition prevents me from doing this because class A and B are not related. It doesn't appear to be a restriction in lodash code itself. Should the type definition be this strict?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels