From 4346c0d6b57fe503d21348246fae20a217d65165 Mon Sep 17 00:00:00 2001 From: John Furrow Date: Sun, 2 Sep 2018 21:19:43 -0700 Subject: [PATCH] Applies eslint rules (#702) --- client/config/env.js | 2 -- client/config/jest/cssTransform.js | 2 -- client/config/jest/fileTransform.js | 2 -- client/config/paths.js | 2 -- client/config/polyfills.js | 2 -- client/config/webpack.config.dev.js | 4 ---- client/config/webpack.config.prod.js | 2 -- client/config/webpackDevServer.config.js | 2 -- client/scripts/build.js | 6 +----- client/scripts/deprecated-warning.js | 2 -- client/scripts/start.js | 3 --- client/scripts/test.js | 2 -- config.docker.js | 4 ++-- package.json | 2 +- server/app.js | 1 - server/bin/enforce-prerequisites.js | 4 ---- server/bin/start.js | 1 - server/bin/web-server.js | 4 +--- server/constants/fileListPropMap.js | 1 - server/constants/historyServiceEvents.js | 2 -- server/constants/notificationServiceEvents.js | 2 -- server/constants/torrentServiceEvents.js | 2 -- server/constants/transferSummaryPropMap.js | 1 - server/middleware/booleanCoerce.js | 2 -- server/models/Feed.js | 2 -- server/models/Filesystem.js | 2 -- server/models/TemporaryStorage.js | 1 - server/models/client.js | 2 -- server/models/settings.js | 2 -- server/services/clientGatewayService.js | 2 -- server/services/historyService.js | 2 -- server/services/notificationService.js | 1 - server/services/taxonomyService.js | 18 ------------------ server/services/torrentService.js | 2 -- server/util/ajaxUtil.js | 2 -- server/util/clientResponseUtil.js | 3 --- server/util/mediainfo.js | 2 -- server/util/methodCallUtil.js | 2 -- shared/constants/clientSettingsMap.js | 4 ---- shared/constants/diffActionTypes.js | 2 -- shared/constants/historySnapshotTypes.js | 2 -- shared/constants/torrentFilePropsMap.js | 2 -- shared/constants/torrentPeerPropsMap.js | 2 -- shared/constants/torrentStatusMap.js | 2 -- shared/constants/torrentTrackerPropsMap.js | 2 -- shared/util/formatUtil.js | 1 - shared/util/objectUtil.js | 1 - shared/util/regEx.js | 4 +--- shared/util/stringUtil.js | 2 -- 49 files changed, 6 insertions(+), 118 deletions(-) diff --git a/client/config/env.js b/client/config/env.js index 688325be..4b34a72c 100644 --- a/client/config/env.js +++ b/client/config/env.js @@ -1,5 +1,3 @@ -'use strict'; - const fs = require('fs'); const path = require('path'); diff --git a/client/config/jest/cssTransform.js b/client/config/jest/cssTransform.js index f1534f6f..56746693 100644 --- a/client/config/jest/cssTransform.js +++ b/client/config/jest/cssTransform.js @@ -1,5 +1,3 @@ -'use strict'; - // This is a custom Jest transformer turning style imports into empty objects. // http://facebook.github.io/jest/docs/tutorial-webpack.html diff --git a/client/config/jest/fileTransform.js b/client/config/jest/fileTransform.js index ffce0da2..3166508c 100644 --- a/client/config/jest/fileTransform.js +++ b/client/config/jest/fileTransform.js @@ -1,5 +1,3 @@ -'use strict'; - const path = require('path'); // This is a custom Jest transformer turning file imports into filenames. diff --git a/client/config/paths.js b/client/config/paths.js index 0504c19f..b4f5ed68 100644 --- a/client/config/paths.js +++ b/client/config/paths.js @@ -1,5 +1,3 @@ -'use strict'; - const path = require('path'); const fs = require('fs'); const userConfig = require('../../config'); diff --git a/client/config/polyfills.js b/client/config/polyfills.js index cbb53ecb..2a5c9712 100644 --- a/client/config/polyfills.js +++ b/client/config/polyfills.js @@ -1,5 +1,3 @@ -'use strict'; - if (typeof Promise === 'undefined') { // Rejection tracking prevents a common issue where React gets into an // inconsistent state due to an error, but it gets swallowed by a Promise, diff --git a/client/config/webpack.config.dev.js b/client/config/webpack.config.dev.js index af889e81..ca07ec99 100644 --- a/client/config/webpack.config.dev.js +++ b/client/config/webpack.config.dev.js @@ -1,5 +1,3 @@ -'use strict'; - const autoprefixer = require('autoprefixer'); const path = require('path'); const webpack = require('webpack'); @@ -163,8 +161,6 @@ module.exports = { loader: require.resolve('css-loader'), options: { importLoaders: 1, - }, - options: { sourceMap: true, }, }, diff --git a/client/config/webpack.config.prod.js b/client/config/webpack.config.prod.js index d4a4bf48..bcdde8c5 100644 --- a/client/config/webpack.config.prod.js +++ b/client/config/webpack.config.prod.js @@ -1,5 +1,3 @@ -'use strict'; - const autoprefixer = require('autoprefixer'); const path = require('path'); const webpack = require('webpack'); diff --git a/client/config/webpackDevServer.config.js b/client/config/webpackDevServer.config.js index cc629e5d..a8d4134a 100644 --- a/client/config/webpackDevServer.config.js +++ b/client/config/webpackDevServer.config.js @@ -1,5 +1,3 @@ -'use strict'; - const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware'); const config = require('./webpack.config.dev'); const paths = require('./paths'); diff --git a/client/scripts/build.js b/client/scripts/build.js index be3618d2..e5e2f7c1 100644 --- a/client/scripts/build.js +++ b/client/scripts/build.js @@ -1,5 +1,3 @@ -'use strict'; - // Do this as the first thing so that any code reading it knows the right env. process.env.BABEL_ENV = 'production'; process.env.NODE_ENV = 'production'; @@ -14,7 +12,6 @@ process.on('unhandledRejection', err => { // Ensure environment variables are read. require('../config/env'); -const path = require('path'); const chalk = require('chalk'); const fs = require('fs-extra'); const webpack = require('webpack'); @@ -22,7 +19,6 @@ const config = require('../config/webpack.config.prod'); const paths = require('../config/paths'); const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles'); const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages'); -const printHostingInstructions = require('react-dev-utils/printHostingInstructions'); const FileSizeReporter = require('react-dev-utils/FileSizeReporter'); const measureFileSizesBeforeBuild = FileSizeReporter.measureFileSizesBeforeBuild; @@ -99,7 +95,7 @@ function build(previousFileSizes) { ) { console.log( chalk.yellow( - '\nTreating warnings as errors because process.env.CI = true.\n' + 'Most CI servers set it automatically.\n' + '\nTreating warnings as errors because process.env.CI = true.\n Most CI servers set it automatically.\n' ) ); return reject(new Error(messages.warnings.join('\n\n'))); diff --git a/client/scripts/deprecated-warning.js b/client/scripts/deprecated-warning.js index 87c5bffd..cadb2c65 100644 --- a/client/scripts/deprecated-warning.js +++ b/client/scripts/deprecated-warning.js @@ -1,5 +1,3 @@ -'use strict'; - const chalk = require('chalk'); const messageDefs = [ diff --git a/client/scripts/start.js b/client/scripts/start.js index 4b04d37c..5f693590 100644 --- a/client/scripts/start.js +++ b/client/scripts/start.js @@ -1,5 +1,3 @@ -'use strict'; - // Do this as the first thing so that any code reading it knows the right env. process.env.BABEL_ENV = 'development'; process.env.NODE_ENV = 'development'; @@ -14,7 +12,6 @@ process.on('unhandledRejection', err => { // Ensure environment variables are read. require('../config/env'); -const fs = require('fs'); const chalk = require('chalk'); const webpack = require('webpack'); const WebpackDevServer = require('webpack-dev-server'); diff --git a/client/scripts/test.js b/client/scripts/test.js index b305b9a5..bf654d67 100644 --- a/client/scripts/test.js +++ b/client/scripts/test.js @@ -1,5 +1,3 @@ -'use strict'; - console.log('There are no tests yet.'); process.exit(0); diff --git a/config.docker.js b/config.docker.js index f102551e..279fd4f7 100644 --- a/config.docker.js +++ b/config.docker.js @@ -9,10 +9,10 @@ const CONFIG = { scgi: { host: process.env.RTORRENT_SCGI_HOST || 'localhost', port: process.env.RTORRENT_SCGI_PORT || 5000, - socket: process.env.RTORRENT_SOCK == 'true', + socket: process.env.RTORRENT_SOCK === 'true' || process.env.RTORRENT_SOCK === true, socketPath: '/data/rtorrent.sock' }, - ssl: process.env.FLOOD_ENABLE_SSL == 'true', + ssl: process.env.FLOOD_ENABLE_SSL === 'true' || process.env.FLOOD_ENABLE_SSL === true, sslKey: '/data/flood_ssl.key', sslCert: '/data/flood_ssl.cert' }; diff --git a/package.json b/package.json index b036e362..3da30857 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "deprecated-warning": "node client/scripts/deprecated-warning.js && sleep 10", "format-source": "node scripts/prettier.js format", "check-source-formatting": "node scripts/prettier.js check", - "lint": "eslint .", + "lint": "eslint --max-warnings 0 .", "start": "node server/bin/start.js", "start:development": "UPDATED_SCRIPT=start:development:server npm run deprecated-warning && npm run start:development:server", "start:development:client": "node client/scripts/start.js", diff --git a/server/app.js b/server/app.js index 89f74bfc..a56719b3 100644 --- a/server/app.js +++ b/server/app.js @@ -12,7 +12,6 @@ const app = express(); const apiRoutes = require('./routes/api'); const authRoutes = require('./routes/auth'); const paths = require('../client/config/paths'); -const services = require('./services'); const Users = require('./models/Users'); Users.bootstrapServicesForAllUsers(); diff --git a/server/bin/enforce-prerequisites.js b/server/bin/enforce-prerequisites.js index 7babed7f..a49d4808 100644 --- a/server/bin/enforce-prerequisites.js +++ b/server/bin/enforce-prerequisites.js @@ -1,5 +1,3 @@ -'use strict'; -const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles'); const fs = require('fs'); const path = require('path'); @@ -9,10 +7,8 @@ const configFiles = [path.join(__dirname, '../../config.js')]; // Taken from react-scripts/check-required-files, but without console.logs. const doFilesExist = files => { - let currentFilePath; try { files.forEach(filename => { - currentFilePath = filename; fs.accessSync(filename, fs.F_OK); }); return true; diff --git a/server/bin/start.js b/server/bin/start.js index 4eb6ccb2..d110cc2c 100644 --- a/server/bin/start.js +++ b/server/bin/start.js @@ -1,4 +1,3 @@ -'use strict'; const chalk = require('chalk'); const enforcePrerequisites = require('./enforce-prerequisites'); diff --git a/server/bin/web-server.js b/server/bin/web-server.js index aedfb246..d400073b 100755 --- a/server/bin/web-server.js +++ b/server/bin/web-server.js @@ -1,5 +1,3 @@ -'use strict'; - const startWebServer = () => { const chalk = require('chalk'); const debug = require('debug')('flood:server'); @@ -20,7 +18,7 @@ const startWebServer = () => { if (useSSL) { if (!config.sslKey || !config.sslCert) { - console.error('Cannot start HTTPS server, `sslKey` or `sslCert`' + ' is missing in config.js.'); + console.error('Cannot start HTTPS server, `sslKey` or `sslCert` is missing in config.js.'); process.exit(1); } diff --git a/server/constants/fileListPropMap.js b/server/constants/fileListPropMap.js index 04075bec..da9f9d43 100644 --- a/server/constants/fileListPropMap.js +++ b/server/constants/fileListPropMap.js @@ -1,4 +1,3 @@ -'use strict'; const fileListPropMap = new Map(); const defaultTransformer = value => value; diff --git a/server/constants/historyServiceEvents.js b/server/constants/historyServiceEvents.js index 9d96fdfe..78113f62 100644 --- a/server/constants/historyServiceEvents.js +++ b/server/constants/historyServiceEvents.js @@ -1,5 +1,3 @@ -'use strict'; - const historySnapshotTypes = require('../../shared/constants/historySnapshotTypes'); const objectUtil = require('../../shared/util/objectUtil'); diff --git a/server/constants/notificationServiceEvents.js b/server/constants/notificationServiceEvents.js index 8a94d64d..33d46210 100644 --- a/server/constants/notificationServiceEvents.js +++ b/server/constants/notificationServiceEvents.js @@ -1,5 +1,3 @@ -'use strict'; - const objectUtil = require('../../shared/util/objectUtil'); const notificationServiceEvents = ['NOTIFICATION_COUNT_CHANGE']; diff --git a/server/constants/torrentServiceEvents.js b/server/constants/torrentServiceEvents.js index 77c9425d..2859e9ea 100644 --- a/server/constants/torrentServiceEvents.js +++ b/server/constants/torrentServiceEvents.js @@ -1,5 +1,3 @@ -'use strict'; - const objectUtil = require('../../shared/util/objectUtil'); const torrentServiceEvents = ['FETCH_TORRENT_LIST_ERROR', 'FETCH_TORRENT_LIST_SUCCESS', 'TORRENT_LIST_DIFF_CHANGE']; diff --git a/server/constants/transferSummaryPropMap.js b/server/constants/transferSummaryPropMap.js index 17cdcc41..323e61bd 100644 --- a/server/constants/transferSummaryPropMap.js +++ b/server/constants/transferSummaryPropMap.js @@ -1,4 +1,3 @@ -'use strict'; const transferSummaryPropMap = new Map(); transferSummaryPropMap.set('upRate', { diff --git a/server/middleware/booleanCoerce.js b/server/middleware/booleanCoerce.js index 5b083e71..a6c5dd43 100644 --- a/server/middleware/booleanCoerce.js +++ b/server/middleware/booleanCoerce.js @@ -1,5 +1,3 @@ -'use strict'; - module.exports = key => { return (req, res, next) => { const value = req.body && req.body[key]; diff --git a/server/models/Feed.js b/server/models/Feed.js index 8c3817ed..4cf43b51 100644 --- a/server/models/Feed.js +++ b/server/models/Feed.js @@ -1,5 +1,3 @@ -'use strict'; - let FeedSub = require('feedsub'); class Feed { diff --git a/server/models/Filesystem.js b/server/models/Filesystem.js index 7d6a026c..1ff100ef 100644 --- a/server/models/Filesystem.js +++ b/server/models/Filesystem.js @@ -1,5 +1,3 @@ -'use strict'; - let fs = require('fs'); let ospath = require('ospath'); let path = require('path'); diff --git a/server/models/TemporaryStorage.js b/server/models/TemporaryStorage.js index 6fddb8a4..778c7424 100644 --- a/server/models/TemporaryStorage.js +++ b/server/models/TemporaryStorage.js @@ -1,4 +1,3 @@ -'use strict'; const fs = require('fs'); const mkdirp = require('mkdirp'); const path = require('path'); diff --git a/server/models/client.js b/server/models/client.js index 4dc419be..a3f13794 100644 --- a/server/models/client.js +++ b/server/models/client.js @@ -1,5 +1,3 @@ -'use strict'; - const fs = require('fs'); const path = require('path'); const series = require('run-series'); diff --git a/server/models/settings.js b/server/models/settings.js index ca7377cc..89f75a4c 100644 --- a/server/models/settings.js +++ b/server/models/settings.js @@ -1,5 +1,3 @@ -'use strict'; - const _ = require('lodash'); const Datastore = require('nedb'); const path = require('path'); diff --git a/server/services/clientGatewayService.js b/server/services/clientGatewayService.js index e48f8ac6..18a9b4fe 100644 --- a/server/services/clientGatewayService.js +++ b/server/services/clientGatewayService.js @@ -1,9 +1,7 @@ -const EventEmitter = require('events'); const path = require('path'); const rimraf = require('rimraf'); const BaseService = require('./BaseService'); -const ClientRequestManager = require('./clientRequestManager'); const clientGatewayServiceEvents = require('../constants/clientGatewayServiceEvents'); const fileListPropMap = require('../constants/fileListPropMap'); const methodCallUtil = require('../util/methodCallUtil'); diff --git a/server/services/historyService.js b/server/services/historyService.js index 140750f2..82fd20c4 100644 --- a/server/services/historyService.js +++ b/server/services/historyService.js @@ -1,5 +1,3 @@ -const EventEmitter = require('events'); - const BaseService = require('./BaseService'); const config = require('../../config'); const HistoryEra = require('../models/HistoryEra'); diff --git a/server/services/notificationService.js b/server/services/notificationService.js index 00b10165..03aad075 100644 --- a/server/services/notificationService.js +++ b/server/services/notificationService.js @@ -1,6 +1,5 @@ const _ = require('lodash'); const Datastore = require('nedb'); -const EventEmitter = require('events'); const path = require('path'); const BaseService = require('./BaseService'); diff --git a/server/services/taxonomyService.js b/server/services/taxonomyService.js index 24c0b282..a794668c 100644 --- a/server/services/taxonomyService.js +++ b/server/services/taxonomyService.js @@ -1,5 +1,3 @@ -const EventEmitter = require('events'); - const BaseService = require('./BaseService'); const clientGatewayServiceEvents = require('../constants/clientGatewayServiceEvents'); const objectUtil = require('../../shared/util/objectUtil'); @@ -47,22 +45,6 @@ class TaxonomyService extends BaseService { clientGatewayService.removeListener(clientGatewayServiceEvents.PROCESS_TORRENT, this.handleProcessTorrent); } - destroy() { - const clientGatewayService = this.services.clientGatewayService; - - clientGatewayService.removeListener( - clientGatewayServiceEvents.PROCESS_TORRENT_LIST_START, - this.handleProcessTorrentListStart - ); - - clientGatewayService.removeListener( - clientGatewayServiceEvents.PROCESS_TORRENT_LIST_END, - this.handleProcessTorrentListEnd - ); - - clientGatewayService.removeListener(clientGatewayServiceEvents.PROCESS_TORRENT, this.handleProcessTorrent); - } - getTaxonomy() { return { id: Date.now(), diff --git a/server/services/torrentService.js b/server/services/torrentService.js index db24b066..3e6ac7cf 100644 --- a/server/services/torrentService.js +++ b/server/services/torrentService.js @@ -1,6 +1,4 @@ const deepEqual = require('deep-equal'); -const EventEmitter = require('events'); - const BaseService = require('./BaseService'); const clientGatewayServiceEvents = require('../constants/clientGatewayServiceEvents'); const config = require('../../config'); diff --git a/server/util/ajaxUtil.js b/server/util/ajaxUtil.js index e03e7428..4782042a 100644 --- a/server/util/ajaxUtil.js +++ b/server/util/ajaxUtil.js @@ -1,5 +1,3 @@ -'use strict'; - let ajaxUtil = { getResponseFn: res => { return (data, error) => { diff --git a/server/util/clientResponseUtil.js b/server/util/clientResponseUtil.js index 6fdbabe2..a5a68628 100644 --- a/server/util/clientResponseUtil.js +++ b/server/util/clientResponseUtil.js @@ -1,7 +1,4 @@ -'use strict'; const geoip = require('geoip-country-only'); -const util = require('util'); - const torrentFilePropsMap = require('../../shared/constants/torrentFilePropsMap'); const torrentPeerPropsMap = require('../../shared/constants/torrentPeerPropsMap'); const torrentTrackerPropsMap = require('../../shared/constants/torrentTrackerPropsMap'); diff --git a/server/util/mediainfo.js b/server/util/mediainfo.js index 527c5691..781754a8 100644 --- a/server/util/mediainfo.js +++ b/server/util/mediainfo.js @@ -1,5 +1,3 @@ -'use strict'; - let child_process = require('child_process'); const services = require('../services'); diff --git a/server/util/methodCallUtil.js b/server/util/methodCallUtil.js index 56230d4f..5ca79f99 100644 --- a/server/util/methodCallUtil.js +++ b/server/util/methodCallUtil.js @@ -1,5 +1,3 @@ -'use strict'; - const methodCallUtil = { getMethodCallConfigFromPropMap(map = new Map(), requestedKeys) { let desiredKeys = Array.from(map.keys()); diff --git a/shared/constants/clientSettingsMap.js b/shared/constants/clientSettingsMap.js index d2e06cf4..027e9492 100644 --- a/shared/constants/clientSettingsMap.js +++ b/shared/constants/clientSettingsMap.js @@ -1,5 +1,3 @@ -'use strict'; - let objectUtil = require('../util/objectUtil'); let clientSettingsMap = objectUtil.reflect({ @@ -37,8 +35,6 @@ let clientSettingsMap = objectUtil.reflect({ systemFileSplitSuffix: 'system.file.split_suffix', throttleGlobalDownMax: 'throttle.global_down.max_rate', throttleGlobalUpMax: 'throttle.global_up.max_rate', - throttleMaxDownloadsDiv: 'throttle.max_downloads.div', - throttleMaxDownloadsGlobal: 'throttle.max_downloads.global', throttleMaxPeersNormal: 'throttle.max_peers.normal', throttleMaxPeersSeed: 'throttle.max_peers.seed', throttleMaxDownloads: 'throttle.max_downloads', diff --git a/shared/constants/diffActionTypes.js b/shared/constants/diffActionTypes.js index bc79cd53..4c5efd57 100644 --- a/shared/constants/diffActionTypes.js +++ b/shared/constants/diffActionTypes.js @@ -1,5 +1,3 @@ -'use strict'; - const diffActionTypes = ['ITEM_ADDED', 'ITEM_CHANGED', 'ITEM_REMOVED']; module.exports = diffActionTypes.reduce((memo, key) => { diff --git a/shared/constants/historySnapshotTypes.js b/shared/constants/historySnapshotTypes.js index e7b3fa9f..88de58ce 100644 --- a/shared/constants/historySnapshotTypes.js +++ b/shared/constants/historySnapshotTypes.js @@ -1,5 +1,3 @@ -'use strict'; - const objectUtil = require('../util/objectUtil'); const historySnapshotTypes = { diff --git a/shared/constants/torrentFilePropsMap.js b/shared/constants/torrentFilePropsMap.js index 60a00870..322dbcdf 100644 --- a/shared/constants/torrentFilePropsMap.js +++ b/shared/constants/torrentFilePropsMap.js @@ -1,5 +1,3 @@ -'use strict'; - const torrentFilePropsMap = { props: ['path', 'pathComponents', 'priority', 'sizeBytes', 'sizeChunks', 'completedChunks'], methods: ['f.path=', 'f.path_components=', 'f.priority=', 'f.size_bytes=', 'f.size_chunks=', 'f.completed_chunks='], diff --git a/shared/constants/torrentPeerPropsMap.js b/shared/constants/torrentPeerPropsMap.js index fe43f0c2..68e23cc1 100644 --- a/shared/constants/torrentPeerPropsMap.js +++ b/shared/constants/torrentPeerPropsMap.js @@ -1,5 +1,3 @@ -'use strict'; - const torrentPeerPropsMap = { props: [ 'address', diff --git a/shared/constants/torrentStatusMap.js b/shared/constants/torrentStatusMap.js index e989bd53..82ab2102 100644 --- a/shared/constants/torrentStatusMap.js +++ b/shared/constants/torrentStatusMap.js @@ -1,5 +1,3 @@ -'use strict'; - const objectUtil = require('../util/objectUtil'); const torrentStatusMap = objectUtil.reflect({ diff --git a/shared/constants/torrentTrackerPropsMap.js b/shared/constants/torrentTrackerPropsMap.js index c1f5805e..f2375968 100644 --- a/shared/constants/torrentTrackerPropsMap.js +++ b/shared/constants/torrentTrackerPropsMap.js @@ -1,5 +1,3 @@ -'use strict'; - const torrentTrackerPropsMap = { props: ['group', 'url', 'id', 'minInterval', 'normalInterval', 'type'], methods: ['t.group=', 't.url=', 't.id=', 't.min_interval=', 't.normal_interval=', 't.type='], diff --git a/shared/util/formatUtil.js b/shared/util/formatUtil.js index 5b486f02..cd2f0c9e 100644 --- a/shared/util/formatUtil.js +++ b/shared/util/formatUtil.js @@ -1,4 +1,3 @@ -'use strict'; let moment = require('moment'); const formatUtil = { diff --git a/shared/util/objectUtil.js b/shared/util/objectUtil.js index fe354809..b23dfe1c 100644 --- a/shared/util/objectUtil.js +++ b/shared/util/objectUtil.js @@ -1,4 +1,3 @@ -'use strict'; const diffActionTypes = require('../constants/diffActionTypes'); const objectUtil = { diff --git a/shared/util/regEx.js b/shared/util/regEx.js index 7810167f..759f096c 100644 --- a/shared/util/regEx.js +++ b/shared/util/regEx.js @@ -1,8 +1,6 @@ -'use strict'; - const regEx = { url: /^(?:https?|ftp):\/\/.{1,}\.{1}.{1,}/, - domainName: /(?:https?|udp):\/\/(?:www\.)?([-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,18}\b)*(\/[\/\d\w\.-]*)*(?:[\?])*(.+)*/i, + domainName: /(?:https?|udp):\/\/(?:www\.)?([-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,18}\b)*(\/[/\d\w.-]*)*(?:[?])*(.+)*/i, }; module.exports = regEx; diff --git a/shared/util/stringUtil.js b/shared/util/stringUtil.js index 612d0d4e..cb325473 100644 --- a/shared/util/stringUtil.js +++ b/shared/util/stringUtil.js @@ -1,5 +1,3 @@ -'use strict'; - module.exports = { capitalize: string => { return string.charAt(0).toUpperCase() + string.slice(1);