stringz
stringz copied to clipboard
Improve unicode support
Require Node.js 16 and move to ESM
Intl.Segmenter
is much more accurate than the regex was.
Fixes #50, Fixes #33
Hi.
Thanks. Im happy to discuss merging this in, I have two concerns though:
- Moving to ESM completely might break some projects that don't support it yet.
- Support for
Intl.Segmenter
is not universal.
Maybe we can release the current (non-esm) version to npm using a @legacy
tag or something and then do a breaking release with the new changes. What do you think?
I'm ok with breaking ESM support but a lack of Intl.Segmenter support is a problem. Not sure what to do.
@Richienb then I think I can add a legacy sub-import to fix this. eg:
if imported from ES6 -> Intl.Segmenter if imported from commonJS -> older version
OR
import stringz from 'stringz'
-> Intl.Segmenter
import stringz from 'stringz/legacy'
-> older version