Changelog:

- Added `getGroupByName() getGroupByGid() getUserByName getUserByUid()` methods to the `Bash` class.

- Fixed a bug inside the `localStorage` caching logic that saved only 32 characters out of 36 in the signature UUID.

- Added support for reverse order sorting in the quick sort implementation.

**Commands:**

- ls
	-l
	-a
	-A
	-U
	-g
	-G
	-h
	-f
	-n
	-N
	-r
	-Q
	-p
	-o
- cd
This commit is contained in:
2025-11-24 03:49:51 +01:00
committed by Kamil Olszewski
parent e853268e52
commit e1fe000608
10 changed files with 215 additions and 114 deletions

View File

@@ -161,4 +161,36 @@ export class Bash {
return `${(bytes / Math.pow(k, i)).toFixed(dp)}${units[i]}`;
}
getGroupByName(name: string): Group {
const out: Group | undefined = this._group.find((group) => group.groupname === name);
console.log(out);
if (out) return out;
else throw new Error(`Cannot find a user group named ${name}`);
}
getUserByName(name: string): User {
const out: User | undefined = this._passwd.find((user) => user.username === name);
console.log(out);
if (out) return out;
else throw new Error(`Cannot find a user named ${name}`);
}
getGroupByGid(gid: number): Group {
const out: Group | undefined = this._group.find((group) => group.gid === gid);
console.log(out);
if (out) return out;
else throw new Error(`Cannot find a user group named ${name}`);
}
getUserByUid(uid: number): User {
const out: User | undefined = this._passwd.find((user) => user.uid === uid);
console.log(out);
if (out) return out;
else throw new Error(`Cannot find a user group named ${name}`);
}
}