@accounts/common
Advanced tools
Comparing version 0.1.0-beta.10 to 0.1.0-beta.11
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var isEmpty = require("lodash/isEmpty"); | ||
var trim = require("lodash/trim"); | ||
var lodash_1 = require("lodash"); | ||
exports.isEmail = function (email) { | ||
@@ -10,7 +9,7 @@ var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | ||
exports.validateEmail = function (email) { | ||
var isValid = !isEmpty(trim(email || '')) && exports.isEmail(email); | ||
var isValid = !lodash_1.isEmpty(lodash_1.trim(email || '')) && exports.isEmail(email); | ||
return Boolean(isValid); | ||
}; | ||
exports.validatePassword = function (password) { | ||
var isValid = !isEmpty(password); | ||
var isValid = !lodash_1.isEmpty(password); | ||
return isValid; | ||
@@ -20,5 +19,5 @@ }; | ||
var usernameRegex = /^[a-zA-Z][a-zA-Z0-9]*$/; | ||
var isValid = username && !isEmpty(trim(username)) && usernameRegex.test(username); | ||
var isValid = username && !lodash_1.isEmpty(lodash_1.trim(username)) && usernameRegex.test(username); | ||
return Boolean(isValid); | ||
}; | ||
//# sourceMappingURL=validators.js.map |
{ | ||
"name": "@accounts/common", | ||
"version": "0.1.0-beta.10", | ||
"version": "0.1.0-beta.11", | ||
"description": "Fullstack authentication and accounts-management", | ||
@@ -32,8 +32,7 @@ "main": "lib/index.js", | ||
"js" | ||
], | ||
"mapCoverage": true | ||
] | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/js-accounts/accounts/tree/master/packages/common" | ||
"url": "https://github.com/accounts-js/accounts/tree/master/packages/common" | ||
}, | ||
@@ -53,2 +52,6 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/jest": "22.2.3", | ||
"@types/lodash": "4.14.108", | ||
"@types/node": "9.6.15", | ||
"jest": "22.4.3", | ||
"localstorage-polyfill": "1.0.1", | ||
@@ -58,4 +61,4 @@ "regenerator-runtime": "0.11.1" | ||
"dependencies": { | ||
"lodash": "^4.16.4" | ||
"lodash": "^4.17.10" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
13907
6
246
1
Updatedlodash@^4.17.10