@contrast/core
Advanced tools
Comparing version 1.31.0 to 1.31.1
@@ -39,2 +39,3 @@ /* | ||
let pkgInfo; | ||
let name; | ||
let err; | ||
@@ -46,2 +47,3 @@ | ||
entrypoint = getEntrypoint(); | ||
name = getApplicationName(); | ||
} catch (_err) { | ||
@@ -64,3 +66,3 @@ err = _err; | ||
pkg: pkgInfo.packageData, | ||
name: config.application.name || pkgInfo.packageData.name, | ||
name, | ||
app_dir: pkgInfo.dir, | ||
@@ -203,2 +205,18 @@ version: config.application.version || pkgInfo.packageData.version, | ||
} | ||
/** | ||
* The name field is required e.g. reporting, rewrite caching, etc. | ||
* @throws {Error} if there is no name identified | ||
*/ | ||
function getApplicationName() { | ||
name = config.application.name || pkgInfo.packageData.name; | ||
if (!name) { | ||
throw new Error( | ||
'The application\'s name was not identified. ' + | ||
'Please provide name in package.json field or with the agent\'s application.name config option.' | ||
); | ||
} | ||
return name; | ||
} | ||
}; |
{ | ||
"name": "@contrast/core", | ||
"version": "1.31.0", | ||
"version": "1.31.1", | ||
"description": "Preconfigured Contrast agent core services and models", | ||
@@ -13,3 +13,3 @@ "license": "SEE LICENSE IN LICENSE", | ||
"npm": ">=6.13.7 <7 || >= 8.3.1", | ||
"node": ">= 14.15.0" | ||
"node": ">= 14.18.0" | ||
}, | ||
@@ -20,3 +20,3 @@ "scripts": { | ||
"dependencies": { | ||
"@contrast/common": "1.20.0", | ||
"@contrast/common": "1.20.1", | ||
"@contrast/find-package-json": "^1.0.0", | ||
@@ -23,0 +23,0 @@ "@contrast/fn-inspect": "^4.0.0" |
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
35451
895
+ Added@contrast/common@1.20.1(transitive)
- Removed@contrast/common@1.20.0(transitive)
Updated@contrast/common@1.20.1