Socket
Socket
Sign inDemoInstall

egg-core

Package Overview
Dependencies
Maintainers
5
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-core - npm Package Compare versions

Comparing version 3.21.0 to 3.21.1

9

History.md
3.21.1 / 2018-05-08
==================
**fixes**
* [[`f58a142`](http://github.com/eggjs/egg-core/commit/f58a142379ea612e15449bd79b848ccebe143607)] - fix: Loader can be instantiated without timing (#161) (Haoliang Gao <<sakura9515@gmail.com>>)
**others**
* [[`72702d8`](http://github.com/eggjs/egg-core/commit/72702d8ba4dedb39a56185fff6dfaa39b8a96f9b)] - refactor: add timing to extend (#162) (Haoliang Gao <<sakura9515@gmail.com>>)
3.21.0 / 2018-05-07

@@ -3,0 +12,0 @@ ==================

20

lib/loader/egg_loader.js

@@ -13,2 +13,3 @@ 'use strict';

const utils = require('../utils');
const Timing = require('../utils/timing');

@@ -36,3 +37,3 @@ const REQUIRE_COUNT = Symbol('EggLoader#requireCount');

this.app = this.options.app;
this.timing = this.app.timing;
this.timing = this.app.timing || new Timing();
this[REQUIRE_COUNT] = 0;

@@ -295,8 +296,19 @@

const timingKey = `Require(${this[REQUIRE_COUNT]++}) ${utils.getResolvedFilename(filepath, this.options.baseDir)}`;
this.timing.start(timingKey);
let ret = utils.loadFile(filepath);
// function(arg1, args, ...) {}
if (inject.length === 0) inject = [ this.app ];
let ret = this.requireFile(filepath);
ret = isFunction(ret) ? ret(...inject) : ret;
return ret;
}
/**
* @param {String} filepath - fullpath
* @return {Object} exports
* @private
*/
requireFile(filepath) {
const timingKey = `Require(${this[REQUIRE_COUNT]++}) ${utils.getResolvedFilename(filepath, this.options.baseDir)}`;
this.timing.start(timingKey);
const ret = utils.loadFile(filepath);
this.timing.end(timingKey);

@@ -303,0 +315,0 @@ return ret;

2

lib/loader/mixin/extend.js

@@ -114,3 +114,3 @@ 'use strict';

const ext = utils.loadFile(filepath);
const ext = this.requireFile(filepath);

@@ -117,0 +117,0 @@ const properties = Object.getOwnPropertyNames(ext)

{
"name": "egg-core",
"version": "3.21.0",
"version": "3.21.1",
"description": "A core Pluggable framework based on koa",

@@ -40,2 +40,3 @@ "main": "index.js",

"egg-ci": "^1.8.0",
"egg-utils": "^2.4.0",
"eslint": "^4.19.1",

@@ -42,0 +43,0 @@ "eslint-config-egg": "^7.0.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc