@mocks-server/core
Advanced tools
Comparing version 3.3.0 to 3.4.0
{ | ||
"name": "@mocks-server/core", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "Pluggable mock server supporting multiple route variants and mocks", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -31,2 +31,6 @@ /* | ||
function formatDeprecatedMessage(format) { | ||
return `Defining Plugins as ${format} is deprecated and it won't be supported in next major version. Consider migrating it to a Class Plugin: https://www.mocks-server.org/docs/plugins-developing-plugins`; | ||
} | ||
class Plugins { | ||
@@ -61,2 +65,3 @@ static get id() { | ||
this._alertsStop = this._alerts.collection("stop"); | ||
this._alertsFormat = this._alerts.collection("format"); | ||
@@ -130,2 +135,4 @@ this._addAlert = addAlert; | ||
let pluginInstance, | ||
formatIsObject, | ||
formatIsFunction, | ||
pluginConfig, | ||
@@ -141,2 +148,3 @@ pluginAlerts, | ||
this._pluginsRegistered++; | ||
formatIsObject = true; | ||
} else { | ||
@@ -168,2 +176,3 @@ try { | ||
this._pluginsRegistered++; | ||
formatIsFunction = true; | ||
} catch (err) { | ||
@@ -219,2 +228,8 @@ return this._catchRegisterError(err, pluginIndex); | ||
} | ||
if (formatIsObject) { | ||
this._alertsFormat.set(this._pluginId(pluginIndex), formatDeprecatedMessage("objects")); | ||
} | ||
if (formatIsFunction) { | ||
this._alertsFormat.set(this._pluginId(pluginIndex), formatDeprecatedMessage("functions")); | ||
} | ||
return pluginInstance; | ||
@@ -221,0 +236,0 @@ } |
116144
3030