@celastrina/message
Advanced tools
Comparing version 1.7.6 to 1.7.7
@@ -128,3 +128,3 @@ /* | ||
/** | ||
* @param {string} message | ||
* @param {*} message | ||
* @returns {Promise<Message>} | ||
@@ -135,5 +135,8 @@ */ | ||
try { | ||
//let msg = JSON.parse(message); | ||
let msg = message; | ||
if(typeof msg !== "object") | ||
let msg; | ||
if(typeof message === "string") | ||
msg = JSON.parse(message); | ||
else msg = message; | ||
if(typeof msg !== "object" || msg == null) | ||
reject(CelastrinaValidationError.newValidationError("Invalid message.", "Message")); | ||
@@ -157,3 +160,3 @@ else { | ||
catch(exception) { | ||
reject(exception); | ||
reject(CelastrinaError.wrapError(exception)); | ||
} | ||
@@ -176,5 +179,2 @@ }); | ||
super(azcontext, config); | ||
azcontext.log.error("Message is object: " + (typeof message === "object")); | ||
azcontext.log.error("Message is string: " + (typeof message === "string")); | ||
azcontext.log.error(message); | ||
/**@type{null|Message}*/this._message = message; | ||
@@ -181,0 +181,0 @@ } |
{ | ||
"name": "@celastrina/message", | ||
"version": "1.7.6", | ||
"version": "1.7.7", | ||
"description": "Celastrina QStorage Function packages for Azure", | ||
@@ -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
15241
333