Comparing version 3.2.0 to 3.3.0
21
index.js
@@ -8,11 +8,18 @@ 'use strict'; | ||
const pTry = require('p-try'); | ||
const filterObj = require('filter-obj'); | ||
const envVars = [ | ||
'GIT_AUTHOR_NAME', | ||
'GIT_COMMITTER_NAME', | ||
'HGUSER', // Mercurial | ||
'C9_USER' // Cloud9 | ||
]; | ||
function checkEnv() { | ||
return pTry(() => { | ||
const env = process.env; | ||
const fullname = env.GIT_AUTHOR_NAME || | ||
env.GIT_COMMITTER_NAME || | ||
env.HGUSER || // Mercurial | ||
env.C9_USER; // Cloud9 | ||
const varName = envVars.find(x => env[x]); | ||
const fullname = varName && env[varName]; | ||
return fullname || Promise.reject(); | ||
@@ -79,2 +86,6 @@ }); | ||
module.exports = mem(getFullName); | ||
module.exports = mem(getFullName, { | ||
cacheKey() { | ||
return JSON.stringify(filterObj(process.env, envVars)); | ||
} | ||
}); |
{ | ||
"name": "fullname", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"description": "Get the fullname of the current user", | ||
@@ -37,3 +37,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"execa": "^0.4.0", | ||
"execa": "^0.6.0", | ||
"filter-obj": "^1.1.0", | ||
"mem": "^1.1.0", | ||
@@ -40,0 +41,0 @@ "p-any": "^1.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
5040
73
7
3
+ Addedfilter-obj@^1.1.0
+ Addedcross-spawn@5.1.0(transitive)
+ Addedexeca@0.6.3(transitive)
+ Addedfilter-obj@1.1.0(transitive)
+ Addedget-stream@3.0.0(transitive)
+ Addednpm-run-path@2.0.2(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
Updatedexeca@^0.6.0