@egodigital/egoose
Advanced tools
Comparing version 6.9.1 to 6.10.0
# Change Log (@egodigital/egoose) | ||
## 6.10.0 | ||
* added `code` and `name` properties to [AppVersion interface](https://egodigital.github.io/egoose/interfaces/_index_.appversion.html) | ||
* updated to `lodash^4.17.15` | ||
* updated to `sanitize-filename^1.6.2` | ||
* removed no needed npm modules | ||
* code cleanups and improvements | ||
## 6.9.1 | ||
@@ -4,0 +12,0 @@ |
@@ -25,2 +25,6 @@ /** | ||
/** | ||
* The version number / code. | ||
*/ | ||
code?: number | false; | ||
/** | ||
* The last commit date. Contains (false), if failed. | ||
@@ -33,2 +37,6 @@ */ | ||
hash?: string | false; | ||
/** | ||
* The (display) name, like "1.5979.0-RC1" | ||
*/ | ||
name?: string | false; | ||
} | ||
@@ -35,0 +43,0 @@ /** |
@@ -25,2 +25,3 @@ "use strict"; | ||
const crypto = require("crypto"); | ||
const fsExtra = require("fs-extra"); | ||
const path = require("path"); | ||
@@ -275,2 +276,3 @@ const moment = require("moment-timezone"); | ||
const VERSION = {}; | ||
// VERSION.date | ||
try { | ||
@@ -285,2 +287,3 @@ VERSION.date = asUTC(moment(child_process_1.execSync('git log -n1 --pretty=%cI HEAD', { | ||
} | ||
// VERSION.hash | ||
try { | ||
@@ -294,2 +297,46 @@ VERSION.hash = normalizeString(child_process_1.execSync('git log --pretty="%H" -n1 HEAD', { | ||
} | ||
// VERSION.code | ||
try { | ||
let buildNr = false; | ||
// first check for 'BUILD_NR' file | ||
const BUILD_NR_FILE = path.resolve(path.join(cwd, 'BUILD_NR')); | ||
if (fsExtra.existsSync(BUILD_NR_FILE)) { // does exist? | ||
if (fsExtra.statSync(BUILD_NR_FILE).isFile()) { // check if file | ||
buildNr = parseInt(fsExtra.readFileSync(BUILD_NR_FILE, 'utf8') | ||
.trim()); | ||
} | ||
} | ||
if (false === buildNr) { | ||
// now try from 'BUILD_NR' env var | ||
const BUILD_NR = toStringSafe(process.env.BUILD_NR) | ||
.trim(); | ||
if ('' !== BUILD_NR) { | ||
buildNr = parseInt(BUILD_NR); | ||
} | ||
} | ||
if (false !== buildNr) { | ||
VERSION.code = isNaN(buildNr) ? | ||
false : buildNr; | ||
} | ||
} | ||
catch (e) { | ||
VERSION.code = false; | ||
} | ||
// VERSION.name | ||
try { | ||
const PACKAGE_JSON_FILE = path.resolve(path.join(cwd, 'package.json')); | ||
if (fsExtra.existsSync(PACKAGE_JSON_FILE)) { // does exist? | ||
if (fsExtra.statSync(PACKAGE_JSON_FILE).isFile()) { // check if file | ||
const PACKAGE_JSON = JSON.parse(fsExtra.readFileSync(PACKAGE_JSON_FILE, 'utf8') | ||
.trim()); | ||
if (PACKAGE_JSON && !isEmptyString(PACKAGE_JSON.version)) { | ||
VERSION.name = toStringSafe(PACKAGE_JSON.version) | ||
.trim(); | ||
} | ||
} | ||
} | ||
} | ||
catch (e) { | ||
VERSION.name = false; | ||
} | ||
return VERSION; | ||
@@ -296,0 +343,0 @@ } |
{ | ||
"name": "@egodigital/egoose", | ||
"version": "6.9.1", | ||
"description": "Helper classes and functions for Node.js 8 or later.", | ||
"version": "6.10.0", | ||
"description": "Helper classes and functions for Node.js 10 or later.", | ||
"main": "lib/index.js", | ||
@@ -49,3 +49,3 @@ "private": false, | ||
"@types/body-parser": "^1.17.0", | ||
"@types/chai": "^4.1.7", | ||
"@types/chai": "^4.2.0", | ||
"@types/errorhandler": "0.0.32", | ||
@@ -61,3 +61,3 @@ "@types/express": "^4.17.0", | ||
"@types/mongoose": "5.2.17", | ||
"@types/node": "^10.14.12", | ||
"@types/node": "^10.14.15", | ||
"@types/node-geocoder": "^3.19.1", | ||
@@ -68,3 +68,3 @@ "@types/redis": "^2.8.13", | ||
"@types/uuid": "^3.4.5", | ||
"@types/ws": "^6.0.1", | ||
"@types/ws": "^6.0.2", | ||
"@types/yargs-parser": "^13.0.0", | ||
@@ -84,3 +84,3 @@ "@types/yazl": "^2.4.1", | ||
"joi": "^14.3.1", | ||
"lodash": "^4.17.13", | ||
"lodash": "^4.17.15", | ||
"merge-deep": "^3.0.2", | ||
@@ -97,3 +97,3 @@ "mime-types": "^2.1.24", | ||
"redis": "^2.8.0", | ||
"sanitize-filename": "^1.6.1", | ||
"sanitize-filename": "^1.6.2", | ||
"swagger-jsdoc-express": "^2.4.0", | ||
@@ -108,7 +108,6 @@ "tmp": "0.0.33", | ||
"@egodigital/tsconfig": "^1.2.0", | ||
"gh-pages": "^2.0.1", | ||
"tslint": "^5.18.0", | ||
"typedoc": "^0.14.2", | ||
"typedoc": "^0.15.0", | ||
"typescript": "3.4.5" | ||
} | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
379507
4
10010
29
Updated@types/chai@^4.2.0
Updated@types/node@^10.14.15
Updated@types/ws@^6.0.2
Updatedlodash@^4.17.15
Updatedsanitize-filename@^1.6.2