Notable changes to this project are documented in this file.
- Security: fixed a ReDoS vulnerability in the domain-matching regex used by
enableTextCleanup(true).
eld.newInstance(): creates a new, fully independent eld instance (its own database, subset, and text-cleanup setting.
detect()now logs aconsole.warnwhen given a non-string argument, then returns the same empty result it always did.- Now each entry point (dynamic and each static size) is a different instance, but still global.
- Static imports with a specific database size:
import { eld } from 'eld/large'; - TypeScript type definitions.
- Dynamic import now requires explicitly loading a database before use:
import { eld } from 'eld';await eld.load('large') - ELD is ~1.5x faster, and more accurate.
- npm install size reduced by 70%.
- More descriptive function names (old names still available, but deprecated):
dynamicLangSubset()is now calledsetLanguageSubset()cleanText()is now calledenableTextCleanup()loadNgrams()is now calledload()