@sap-cloud-sdk/util
Advanced tools
Comparing version 1.18.1 to 1.18.2-alpha.2
@@ -11,3 +11,5 @@ "use strict"; | ||
} | ||
var inProject = fs_1.readdirSync(path).includes('package.json') || fs_1.readdirSync(path).includes('node_modules') || path.includes('node_modules'); | ||
var inProject = fs_1.readdirSync(path).includes('package.json') || | ||
fs_1.readdirSync(path).includes('node_modules') || | ||
path.includes('node_modules'); | ||
if (!inProject) { | ||
@@ -14,0 +16,0 @@ return lastPath; |
@@ -78,6 +78,12 @@ "use strict"; | ||
function createLogger(messageContext) { | ||
var customFields = typeof messageContext === 'string' ? { messageContext: messageContext } : __assign({}, messageContext); | ||
var customFields = typeof messageContext === 'string' | ||
? { messageContext: messageContext } | ||
: __assign({}, messageContext); | ||
return container.get(customFields.messageContext, { | ||
level: customLogLevels[customFields.messageContext] || customFields.level || 'info', | ||
defaultMeta: __assign(__assign({}, (Object.entries(customFields).length && { custom_fields: customFields })), { logger: customFields.logger || loggerReference }), | ||
level: customLogLevels[customFields.messageContext] || | ||
customFields.level || | ||
'info', | ||
defaultMeta: __assign(__assign({}, (Object.entries(customFields).length && { | ||
custom_fields: customFields | ||
})), { logger: customFields.logger || loggerReference }), | ||
format: format, | ||
@@ -108,3 +114,5 @@ transports: [new winston_1.transports.Console()] | ||
if (messageContextOrLogger === void 0) { messageContextOrLogger = DEFAULT_LOGGER__MESSAGE_CONTEXT; } | ||
var messageContext = typeof messageContextOrLogger === 'string' ? messageContextOrLogger : getMessageContext(messageContextOrLogger); | ||
var messageContext = typeof messageContextOrLogger === 'string' | ||
? messageContextOrLogger | ||
: getMessageContext(messageContextOrLogger); | ||
if (messageContext) { | ||
@@ -126,3 +134,5 @@ customLogLevels[messageContext] = level; | ||
var loggerOptions = logger; | ||
if (loggerOptions && loggerOptions.defaultMeta && loggerOptions.defaultMeta.custom_fields) { | ||
if (loggerOptions && | ||
loggerOptions.defaultMeta && | ||
loggerOptions.defaultMeta.custom_fields) { | ||
return loggerOptions.defaultMeta.custom_fields.messageContext; | ||
@@ -129,0 +139,0 @@ } |
@@ -25,3 +25,5 @@ "use strict"; | ||
exports.local = combine(timestamp(), winston_1.format(function (info) { return (__assign(__assign({}, info), { level: info.level.toUpperCase() })); })(), cli(), printf(function (info) { | ||
var messageContext = info.custom_fields && info.custom_fields.messageContext ? chalk_1.default.blue("(" + info.custom_fields.messageContext + ")") + ": " : ''; | ||
var messageContext = info.custom_fields && info.custom_fields.messageContext | ||
? chalk_1.default.blue("(" + info.custom_fields.messageContext + ")") + ": " | ||
: ''; | ||
var trimmedMessage = info.message.replace(/^\s*/, ''); | ||
@@ -28,0 +30,0 @@ var paddingLength = info.message.length - trimmedMessage.length + messageContext.length; |
{ | ||
"name": "@sap-cloud-sdk/util", | ||
"version": "1.18.1", | ||
"version": "1.18.2-alpha.2+1087e72", | ||
"description": "SAP Cloud SDK for JavaScript general utilities", | ||
@@ -35,3 +35,3 @@ "homepage": "https://community.sap.com/topics/cloud-sdk", | ||
"chalk": "^2.4.2", | ||
"rambda": "2.14.5", | ||
"rambda": "^5.0.0", | ||
"winston": "^3.2.1" | ||
@@ -46,3 +46,3 @@ }, | ||
}, | ||
"gitHead": "87d9876db60553cc2eda99b8bd9ddec89b81573e" | ||
"gitHead": "1087e7296bb2c9462efc8dffd7b3134af4ac199a" | ||
} |
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
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
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
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
50953
541
1
1
+ Addedrambda@5.13.1(transitive)
- Removedrambda@2.14.5(transitive)
Updatedrambda@^5.0.0