Skip to content

Commit

Permalink
perf: remove arguments of the removed 'requireSafe'
Browse files Browse the repository at this point in the history
  • Loading branch information
gerard2perez committed Sep 20, 2017
1 parent 23bddf8 commit 97efa34
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/middleware/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function initialize () {
let routers = glob('koaton_modules/**/routes.js').concat(glob('routes.js'));
for (const router of routers) {
let location = path.dirname(router);
let PackageSubdomains = require(ProyPath(location, 'config', 'server.js'), {default: { subdomains: [] }}).default.subdomains;
let PackageSubdomains = require(ProyPath(location, 'config', 'server.js')).default.subdomains;
for (const subdomain of PackageSubdomains) {
if (!subdomainRouters[subdomain]) {
subdomainRouters[subdomain] = new KoatonRouter(subdomain);
Expand Down
2 changes: 1 addition & 1 deletion src/support/KoatonRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export default class KoatonRouter {
model = url;
url = undefined;
}
let controller = require(ProyPath(this.loc, 'controllers', model), {}).default;
let controller = require(ProyPath(this.loc, 'controllers', model)).default;
controller = Object.assign({
Name: model,
Namespace: '',
Expand Down
2 changes: 1 addition & 1 deletion src/support/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class Configuration {
let modules = glob(ProyPath('config', '**', '*.js'));
let moduleNames = [];
for (const configFile of modules) {
let config = require(configFile, {default: {}}).default;
let config = require(configFile).default;
const moduleName = basename(configFile).replace(extname(configFile), '');
moduleNames.push(moduleName);
/** @ignore */
Expand Down
4 changes: 2 additions & 2 deletions src/support/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ global.cleanString = (text) => {
* @param {Object=} [defaults={}] - Object to return if require fails.
* @returns {Object} The required library (always) fresh.
*/
global.requireNoCache = function requireNoCache (lib, defaults) {
global.requireNoCache = function requireNoCache (lib) {
let library = rawpath.normalize(rawpath.resolve(lib));
if (library.indexOf('.json') === -1) {
library = library.replace('.js', ''); // + '.js';
}
delete require.cache[library];
return require(library, defaults);
return require(library);
};

/**
Expand Down

0 comments on commit 97efa34

Please sign in to comment.