Files
the-jailor/wwwroot/core/usersToken.js
2025-11-09 10:23:23 +01:00

26 lines
481 B
JavaScript

import JsonManager from "./utils/jsonManager.js";
export class UsersToken {
constructor(filePath) {
this.filePath = filePath;
this.data = JsonManager.read(this.filePath);
}
reload() {
this.data = JsonManager.read(this.filePath);
}
upsert(data) {
JsonManager.upsertToken(this.filePath, data);
this.reload();
}
get(index){
return this.data[index];
}
getAll(){
return this.data;
}
}