react-application-core
Version:
A react-based application core for the business applications.
35 lines • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PasswordUtils = void 0;
var definition_1 = require("../definition");
var type_1 = require("./type");
/**
* @stable [22.01.2021]
* @param value
*/
var isStrong = function (value) {
if (type_1.TypeUtils.isNotEmptyString(value)) {
return value.length >= 8
&& /[A-Z]/.test(value)
&& /[a-z]/.test(value)
&& definition_1.RegexpConstants.SPECIAL_CHARACTER.test(value);
}
return false;
};
/**
* @stable [22.01.2021]
* @param value
*/
var isStrongOptional = function (value) { return type_1.TypeUtils.isOptionalObject(value) || isStrong(value); };
/**
* @stable [03.11.2020]
*/
var PasswordUtils = /** @class */ (function () {
function PasswordUtils() {
}
PasswordUtils.isStrong = isStrong;
PasswordUtils.isStrongOptional = isStrongOptional;
return PasswordUtils;
}());
exports.PasswordUtils = PasswordUtils;
//# sourceMappingURL=password.js.map