mybase 1.0.36 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/mybase.js +3 -1
  2. package/package.json +3 -2
package/mybase.js CHANGED
@@ -6,7 +6,7 @@ const chalk = require('chalk')
6
6
  const punycode = require('punycode');
7
7
  const _validURL = require('@7c/validurl')
8
8
  const { match } = require('assert');
9
-
9
+ const validator = require('validator')
10
10
 
11
11
  Date.prototype.yyyymmdd = function() {
12
12
  var mm = this.getMonth() + 1; // getMonth() is zero-based
@@ -23,6 +23,8 @@ function validHPassword(hpassword) { return (hpassword && hpassword.length === 1
23
23
  function validEmail_old(email) { return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)) }
24
24
 
25
25
  function validEmail(email) {
26
+ return validator.isEmail(email)
27
+ // giving up old style, was not reliable
26
28
  // taken from https://www.w3resource.com/javascript/form/email-validation.php
27
29
  // strange looking emails might be indeed valid
28
30
  // check https://www.w3resource.com/javascript/form/example-javascript-form-validation-email-REC-2822.html
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mybase",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "",
5
5
  "main": "mybase.js",
6
6
  "scripts": {
@@ -12,7 +12,8 @@
12
12
  "@7c/validurl": "0.0.3",
13
13
  "chalk": "^3.0.0",
14
14
  "debug": "^4.3.1",
15
- "punycode": "^2.1.1"
15
+ "punycode": "^2.1.1",
16
+ "validator": "^13.7.0"
16
17
  },
17
18
  "devDependencies": {
18
19
  "chai": "^4.2.0",