| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cb15017 commit ad0072a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,7 @@ const { | |||
| 40 | 40 | getOSType: _getOSType, | |
| 41 | 41 | getPriority: _getPriority, | |
| 42 | 42 | getTotalMem, | |
| 43 | - getUserInfo: _getUserInfo, | ||
| 43 | + getUserInfo, | ||
| 44 | 44 | getUptime, | |
| 45 | 45 | isBigEndian, | |
| 46 | 46 | setPriority: _setPriority | |
@@ -64,7 +64,6 @@ const getHostname = getCheckedFunction(_getHostname); | |||
| 64 | 64 | const getInterfaceAddresses = getCheckedFunction(_getInterfaceAddresses); | |
| 65 | 65 | const getOSRelease = getCheckedFunction(_getOSRelease); | |
| 66 | 66 | const getOSType = getCheckedFunction(_getOSType); | |
| 67 | - const getUserInfo = getCheckedFunction(_getUserInfo); | ||
| 68 | 67 | ||
| 69 | 68 | getFreeMem[Symbol.toPrimitive] = () => getFreeMem(); | |
| 70 | 69 | getHostname[Symbol.toPrimitive] = () => getHostname(); | |
@@ -239,6 +238,19 @@ function getPriority(pid) { | |||
| 239 | 238 | return priority; | |
| 240 | 239 | } | |
| 241 | 240 | ||
| 241 | + function userInfo(options) { | ||
| 242 | + if (typeof options !== 'object') | ||
| 243 | + options = null; | ||
| 244 | + | ||
| 245 | + const ctx = {}; | ||
| 246 | + const user = getUserInfo(options, ctx); | ||
| 247 | + | ||
| 248 | + if (user === undefined) | ||
| 249 | + throw new ERR_SYSTEM_ERROR(ctx); | ||
| 250 | + | ||
| 251 | + return user; | ||
| 252 | + } | ||
| 253 | + | ||
| 242 | 254 | module.exports = { | |
| 243 | 255 | arch, | |
| 244 | 256 | cpus, | |
@@ -255,7 +267,7 @@ module.exports = { | |||
| 255 | 267 | tmpdir, | |
| 256 | 268 | totalmem: getTotalMem, | |
| 257 | 269 | type: getOSType, | |
| 258 | - userInfo: getUserInfo, | ||
| 270 | + userInfo, | ||
| 259 | 271 | uptime: getUptime, | |
| 260 | 272 | ||
| 261 | 273 | // Deprecated APIs | |
| Back | FazBrowse Home | New Git URL |
0 commit comments