@blacklane/kiev-js
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -24,3 +24,3 @@ 'use strict'; | ||
function createMessage(message, event, messageEvent, logLevel) { | ||
return JSON.stringify({ | ||
var data = { | ||
timestamp: new Date().toISOString(), | ||
@@ -33,3 +33,7 @@ log_level: logLevel, | ||
} | ||
}); | ||
}; | ||
{ | ||
return data; | ||
} | ||
} | ||
@@ -36,0 +40,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
"use strict";var e;function n(e,n,o,r){return JSON.stringify({timestamp:(new Date).toISOString(),log_level:r,event:n,body:e,message:{event:o}})}Object.defineProperty(exports,"__esModule",{value:!0}),function(e){e.INFO="info",e.WARN="warn",e.ERROR="error"}(e||(e={})),exports.default={info:function(o,r,t){console.info(n(o,r,t,e.INFO))},warn:function(o,r,t){console.warn(n(o,r,t,e.WARN))},error:function(o,r,t){console.error(n(o,r,t,e.ERROR))}}; | ||
"use strict";var e;function n(e,n,o,r){var t={timestamp:(new Date).toISOString(),log_level:r,event:n,body:e,message:{event:o}};return JSON.stringify(t)}Object.defineProperty(exports,"__esModule",{value:!0}),function(e){e.INFO="info",e.WARN="warn",e.ERROR="error"}(e||(e={})),exports.default={info:function(o,r,t){console.info(n(o,r,t,e.INFO))},warn:function(o,r,t){console.warn(n(o,r,t,e.WARN))},error:function(o,r,t){console.error(n(o,r,t,e.ERROR))}}; | ||
//# sourceMappingURL=kiev-js.cjs.production.min.js.map |
@@ -20,3 +20,3 @@ var LogLevel; | ||
function createMessage(message, event, messageEvent, logLevel) { | ||
return JSON.stringify({ | ||
var data = { | ||
timestamp: new Date().toISOString(), | ||
@@ -29,3 +29,9 @@ log_level: logLevel, | ||
} | ||
}); | ||
}; | ||
if (process.env.NODE_ENV === 'development') { | ||
return data; | ||
} | ||
return JSON.stringify(data); | ||
} | ||
@@ -32,0 +38,0 @@ /** |
{ | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"license": "MIT", | ||
@@ -4,0 +4,0 @@ "main": "dist/index.js", |
@@ -7,2 +7,12 @@ enum LogLevel { | ||
interface Message { | ||
timestamp: string | ||
log_level: string | ||
event: string | ||
body: unknown | ||
message: { | ||
event: string | ||
} | ||
} | ||
/** | ||
@@ -22,4 +32,4 @@ * Creates the message structure. | ||
logLevel: LogLevel | ||
): string { | ||
return JSON.stringify({ | ||
): string | Message { | ||
const data: Message = { | ||
timestamp: new Date().toISOString(), | ||
@@ -32,3 +42,9 @@ log_level: logLevel, | ||
} | ||
}) | ||
} | ||
if (process.env.NODE_ENV === 'development') { | ||
return data | ||
} | ||
return JSON.stringify(data) | ||
} | ||
@@ -35,0 +51,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
26718
298
0