validate-password
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "validate-password", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Strengthen your user's passwords", | ||
@@ -5,0 +5,0 @@ "author": "Mike DeWitt <mdewitt07@gmail.com>", |
@@ -1,5 +0,7 @@ | ||
var extend = require('lodash/fp/extend'); | ||
module.exports = ValidatePassword; | ||
/* | ||
** Main ValidatePassword method | ||
*/ | ||
function ValidatePassword(options) { | ||
@@ -9,2 +11,34 @@ this.options = options; | ||
/* | ||
** Polyfill for Object.assign | ||
** See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill | ||
*/ | ||
if (typeof Object.assign != 'function') { | ||
(function () { | ||
Object.assign = function (target) { | ||
'use strict'; | ||
if (target === undefined || target === null) { | ||
throw new TypeError('Cannot convert undefined or null to object'); | ||
} | ||
var output = Object(target); | ||
for (var index = 1; index < arguments.length; index++) { | ||
var source = arguments[index]; | ||
if (source !== undefined && source !== null) { | ||
for (var nextKey in source) { | ||
if (source.hasOwnProperty(nextKey)) { | ||
output[nextKey] = source[nextKey]; | ||
} | ||
} | ||
} | ||
} | ||
return output; | ||
}; | ||
})(); | ||
} | ||
/* | ||
** Main checkPassword method | ||
*/ | ||
ValidatePassword.prototype.checkPassword = function(password, forbiddenStrings) { | ||
@@ -25,5 +59,4 @@ var validationData = { | ||
var options = extend(defaultOptions, this.options); | ||
var options = Object.assign(defaultOptions, this.options); | ||
var checkForbiddenStringsData; | ||
var minLengthValidationMessage; | ||
@@ -70,3 +103,5 @@ if (!password) { | ||
//Helper Methods | ||
/* | ||
** Helper methods | ||
*/ | ||
@@ -73,0 +108,0 @@ function hasLowerCase(pw) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
1
23402
401
2