Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change usage of library #244

Merged
merged 12 commits into from
Jan 17, 2024
Merged

Change usage of library #244

merged 12 commits into from
Jan 17, 2024

Conversation

MrWook
Copy link
Collaborator

@MrWook MrWook commented Dec 8, 2023

Closes: #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:

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)

BREAKING: we moved to a class based approach where the options are handled in the constructor to get rid of the option singleton
BREAKING: we moved to a class based approach where the options are handled in the constructor to get rid of the option singleton
@MrWook MrWook added the enhancement New feature or request label Dec 8, 2023
@MrWook MrWook added this to the 4.0.0 milestone Dec 8, 2023
@MrWook MrWook merged commit 4633c79 into master Jan 17, 2024
6 checks passed
@MrWook MrWook deleted the feat!/change-usage-of-library branch February 1, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve usage of this library
2 participants