1
0
mirror of https://github.com/SomboChea/ui synced 2024-12-25 05:34:26 +07:00

chore: validator use less bundle size (#61)

This commit is contained in:
Juan Picado @jotadeveloper 2019-05-16 22:58:56 -07:00 committed by VerdaccioBot
parent 023b1159f7
commit bd7329f807
4 changed files with 22 additions and 4 deletions

2
.gitignore vendored
View File

@ -16,4 +16,4 @@ __tests__
# Compiled script
static/*
coverage/
stats.json

View File

@ -96,6 +96,7 @@
"verdaccio-memory": "2.0.0",
"webpack": "4.20.2",
"webpack-bundle-analyzer": "3.0.4",
"webpack-bundle-size-analyzer": "3.0.0",
"webpack-cli": "3.2.3",
"webpack-dev-server": "3.2.1",
"webpack-merge": "4.2.1",
@ -121,6 +122,8 @@
"dev:web": "cross-env BABEL_ENV=ui babel-node tools/dev.server.js",
"verdaccio:server": "node tools/verdaccio.js",
"build": "npm run pre:webpack && cross-env BABEL_ENV=ui webpack --config tools/webpack.prod.config.babel.js",
"build:stats": "cross-env BABEL_ENV=ui webpack --config tools/webpack.prod.config.babel.js --json > stats.json",
"build:size": "cross-env BABEL_ENV=ui webpack --config tools/webpack.prod.config.babel.js --json | webpack-bundle-size-analyzer",
"dev": "concurrently --kill-others \"npm run dev:web\" \"npm run verdaccio:server\""
},
"engines": {

View File

@ -1,14 +1,15 @@
import validator from 'validator';
import isURLValidator from 'validator/lib/isURL';
import isEmailValidator from 'validator/lib/isEmail';
export function isURL(url) {
return validator.isURL(url || '', {
return isURLValidator(url || '', {
protocols: ['http', 'https', 'git+https'],
require_protocol: true,
});
}
export function isEmail(email) {
return validator.isEmail(email || '');
return isEmailValidator(email || '');
}
export function getRegistryURL() {

View File

@ -6519,6 +6519,11 @@ https-proxy-agent@^2.2.1:
agent-base "^4.1.0"
debug "^3.1.0"
humanize@0.0.9:
version "0.0.9"
resolved "https://registry.verdaccio.org/humanize/-/humanize-0.0.9.tgz#1994ffaecdfe9c441ed2bdac7452b7bb4c9e41a4"
integrity sha1-GZT/rs3+nEQe0r2sdFK3u0yeQaQ=
husky@0.15.0-rc.8:
version "0.15.0-rc.8"
resolved "https://registry.npmjs.org/husky/-/husky-0.15.0-rc.8.tgz#b658c597a8f9bbcd00a5c039709e7c61e61238e7"
@ -13391,6 +13396,15 @@ webpack-bundle-analyzer@3.0.4:
opener "^1.5.1"
ws "^6.0.0"
webpack-bundle-size-analyzer@3.0.0:
version "3.0.0"
resolved "https://registry.verdaccio.org/webpack-bundle-size-analyzer/-/webpack-bundle-size-analyzer-3.0.0.tgz#c0657e9787cf644a0b91d891ae15553ba61bbc71"
integrity sha512-GfQ/Mch1o2MGonGPIMawwlxXOmYp/F8EXiT9txDO6qASo7G5hODngWMNW1KkJxeYRvgMUuPgbSsmdsXEsBNEeg==
dependencies:
commander "^2.19.0"
filesize "^3.6.1"
humanize "0.0.9"
webpack-cli@3.2.3:
version "3.2.3"
resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.2.3.tgz#13653549adfd8ccd920ad7be1ef868bacc22e346"