mirror of
https://github.com/bitwarden/browser
synced 2026-01-09 20:13:42 +00:00
32 lines
668 B
TypeScript
32 lines
668 B
TypeScript
import { FolderData } from '../data/folderData';
|
|
|
|
import { CipherString } from './cipherString';
|
|
import Domain from './domain';
|
|
|
|
export class Folder extends Domain {
|
|
id: string;
|
|
name: CipherString;
|
|
|
|
constructor(obj?: FolderData, alreadyEncrypted: boolean = false) {
|
|
super();
|
|
if (obj == null) {
|
|
return;
|
|
}
|
|
|
|
this.buildDomainModel(this, obj, {
|
|
id: null,
|
|
name: null,
|
|
}, alreadyEncrypted, ['id']);
|
|
}
|
|
|
|
decrypt(): Promise<any> {
|
|
const model = {
|
|
id: this.id,
|
|
};
|
|
|
|
return this.decryptObj(model, {
|
|
name: null,
|
|
}, null);
|
|
}
|
|
}
|