We move away from the painfull singleton usage to a class based approach to handle multiple options at the same time and make it less error prone it different setups.
This way we get the setup like this:
import { ZxcvbnFactory } from '@zxcvbn-ts/core'
import * as zxcvbnEnPackage from '@zxcvbn-ts/language-en'
const options = {
translations: zxcvbnEnPackage.translations,
}
const zxcvbn = new ZxcvbnFactory(options)
const password = 'somePassword'
zxcvbn.check(password)
Closes: https://github.com/zxcvbn-ts/zxcvbn/issues/194
We move away from the painfull singleton usage to a class based approach to handle multiple options at the same time and make it less error prone it different setups. This way we get the setup like this: