Skip to content

@types/underscore error TS2322 for _.chain after upgrade to v1.9 #36308

@smileLilith

Description

@smileLilith

After upgrade of @types/underscore from v1.8.20 to v1.9.0 all usages of _.chain in my angular project were broken. For example

const arr1: string[] = ['z', 'x', 'y'], query = 'z';
let arr2: string[] = ['a', 'b', 'c'];
...
arr2 = _.chain(arr1)
      .union(arr2)
      .without(query)
      .value()

has returned

error TS2322: Type 'string' is not assignable to type 'string[]'

It seems it was caused by changes done in this commit.

@regevbr, @DanielRosenwasser was this expected? If yes, what is upgrade path?

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