#1931·es-toolkit

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

Author: foucdegCreated Jul 21, 2026Updated Aug 28, 2026

Hello,

Just some feedback about the fix https://github.com/toss/es-toolkit/pull/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!