mirror of
https://github.com/bitwarden/cli
synced 2025-12-06 04:23:19 +00:00
21 lines
591 B
TypeScript
21 lines
591 B
TypeScript
import { CollectionView } from 'jslib/models/view/collectionView';
|
|
|
|
export class Collection {
|
|
static toView(req: Collection, view = new CollectionView()) {
|
|
view.name = req.name;
|
|
if (view.organizationId == null) {
|
|
view.organizationId = req.organizationId;
|
|
}
|
|
return view;
|
|
}
|
|
|
|
organizationId: string;
|
|
name: string;
|
|
|
|
// Use build method instead of ctor so that we can control order of JSON stringify for pretty print
|
|
build(o: CollectionView) {
|
|
this.organizationId = o.organizationId;
|
|
this.name = o.name;
|
|
}
|
|
}
|