Please sign in to comment.
Export zxcvbn function conditional on the environment
Rather than directly attaching the zxcvbn function to the `window` object, check first if the window exists (i.e., we are in a browser environment). If not, then we may be in a CommonJS environment, and we can export the function by attaching it to the `exports` object.
- Loading branch information...