Socket
Socket
Sign inDemoInstall

egg-core

Package Overview
Dependencies
Maintainers
13
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 4.17.6 to 4.18.0

lib/egg_context.js

6

History.md
4.18.0 / 2020-08-18
==================
**features**
* [[`9b371fa`](http://github.com/eggjs/egg-core/commit/9b371fa55b80d8322995329da758e98fba3c5060)] - feat: support enable/disable/clear timing (#224) (TZ | 天猪 <<atian25@qq.com>>)
4.17.6 / 2020-08-05

@@ -3,0 +9,0 @@ ==================

18

lib/utils/timing.js

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

constructor() {
this._enable = true;
this[MAP] = new Map();

@@ -17,3 +18,3 @@ this[LIST] = [];

start(name) {
if (!name) return;
if (!name || !this._enable) return;

@@ -37,3 +38,3 @@ if (this[MAP].has(name)) this.end(name);

end(name) {
if (!name) return;
if (!name || !this._enable) return;
assert(this[MAP].has(name), `should run timing.start('${name}') first`);

@@ -47,2 +48,15 @@

enable() {
this._enable = true;
}
disable() {
this._enable = false;
}
clear() {
this[MAP].clear();
this[LIST] = [];
}
toJSON() {

@@ -49,0 +63,0 @@ return this[LIST];

2

package.json
{
"name": "egg-core",
"version": "4.17.6",
"version": "4.18.0",
"description": "A core Pluggable framework based on koa",

@@ -5,0 +5,0 @@ "main": "index.js",

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