mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
30 lines
657 B
TypeScript
30 lines
657 B
TypeScript
import { FolderData } from '../data';
|
|
|
|
import { FolderView } from '../view';
|
|
|
|
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<FolderView> {
|
|
return this.decryptObj(new FolderView(this), {
|
|
name: null,
|
|
}, null);
|
|
}
|
|
}
|