egg-core
Advanced tools
Comparing version 4.17.6 to 4.18.0
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 @@ ================== |
@@ -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]; |
{ | ||
"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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125186
25
2945