You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Implementation of Object.groupBy according to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/groupBy
264
+
exportfunctiongroupBy(arr,fn){
265
+
returnarr.reduce((out,x)=>{
266
+
constkey=fn(x);
267
+
if(!(keyinout))out[key]=[];
268
+
out[key].push(x);
269
+
returnout;
270
+
},{})
271
+
}
272
+
160
273
exportasyncfunctiongetSSHKeys(users,baseDir){
161
274
constsshKeyFiles=awaitPromise.all(
162
275
users.map(async(u)=>{
@@ -168,4 +281,38 @@ export async function getSSHKeys(users, baseDir) {
168
281
);
169
282
170
283
returnObject.fromEntries(sshKeyFiles);
284
+
}
285
+
286
+
/**
287
+
* Retrieves the disk quota information for a given path.
288
+
* @param {string} path - The path for which to retrieve the disk quota.
289
+
* @returns {Promise<Object>} - A promise that resolves to an object of the form { <uid>: { bytes_soft_limit, bytes_hard_limit, inodes_soft_limit, inodes_hard_limit }}
290
+
*/
291
+
exportasyncfunctiongetDiskQuotaForPath(path){
292
+
// outputs <uid> <block soft> <block hard> <inode soft> <inode hard> where block is in 1KiB units
* @param {string[]} paths - An array of paths for which to retrieve the disk quota.
310
+
* @returns {Promise<Object>} - A promise that resolves to an object of the form { <path>: { <uid>: { bytes_soft_limit, bytes_hard_limit, inodes_soft_limit, inodes_hard_limit }}}
0 commit comments