mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-15 02:31:02 +00:00
Control priv access via # (#286)
This commit is contained in:
@@ -10,19 +10,19 @@ import path from 'path';
|
||||
|
||||
// NOTE untested and unused by any known apps, probably broken in various mysterious ways
|
||||
export default class FileStore implements KeyringStore {
|
||||
private _path: string;
|
||||
#path: string;
|
||||
|
||||
constructor (path: string) {
|
||||
if (!fs.existsSync(path)) {
|
||||
mkdirp.sync(path);
|
||||
}
|
||||
|
||||
this._path = path;
|
||||
this.#path = path;
|
||||
}
|
||||
|
||||
public all (cb: (key: string, value: KeyringJson) => void): void {
|
||||
fs
|
||||
.readdirSync(this._path)
|
||||
.readdirSync(this.#path)
|
||||
.filter((key): boolean => !['.', '..'].includes(key))
|
||||
.forEach((key): void => {
|
||||
cb(key, this._readKey(key));
|
||||
@@ -44,7 +44,7 @@ export default class FileStore implements KeyringStore {
|
||||
}
|
||||
|
||||
private _getPath (key: string): string {
|
||||
return path.join(this._path, key);
|
||||
return path.join(this.#path, key);
|
||||
}
|
||||
|
||||
private _readKey (key: string): KeyringJson {
|
||||
|
||||
Reference in New Issue
Block a user