Skip to content

Lodash's _.mapKeys(object, ...) fails if object is type Object #14282

@Shingyx

Description

@Shingyx
  • I tried using the latest lodash/index.d.ts file in this repo and had problems.
  • I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • I want to talk about lodash/index.d.ts.

If I call _mapKeys(object, ...) with object being type Object, TypeScript gives the following error when it tries to compile:
error TS2345: Argument of type 'Object' is not assignable to parameter of type 'List<{}> | Dictionary<{}>'

I think this should work judging by Lodash's documention: https://lodash.com/docs/4.17.4#mapKeys

There was a similar problem in the past regarding _.some(), found here: #8630

Could you please look into this?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions