Skip to content

trimStart thowing on multi-character string chars is a breaking change and a Lodash compatibility break #1931

Description

@foucdeg

Hello,

Just some feedback about the fix #1615 introduced in v1.49 (trimStart throwing an error when chars is a multi-character string).
While I understand and agree with the intention, transforming an undeterminate behaviour into a thrown error should have been considered a breaking change. It did break something on our side.
IMO, the better way to introduce this in a minor release should have been a deprecation warning.

I also suggest editing the docs to make this constraint more explicit. While the examples only show one-character strings, the spec for the argument does not specify that it should be a one-character string. This is especially important for people migrating from Lodash (as Lodash's equivalent does support multi-character strings - this breaks the 1-1 compatibility promise).

Thanks for the hard work!

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