mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
pretty print json
This commit is contained in:
@@ -12,9 +12,9 @@ import { SecureNote } from './secureNote';
|
||||
export class Cipher {
|
||||
static template(): Cipher {
|
||||
const req = new Cipher();
|
||||
req.type = CipherType.Login;
|
||||
req.folderId = null;
|
||||
req.organizationId = null;
|
||||
req.folderId = null;
|
||||
req.type = CipherType.Login;
|
||||
req.name = 'Item name';
|
||||
req.notes = 'Some notes about this item.';
|
||||
req.favorite = false;
|
||||
@@ -70,11 +70,8 @@ export class Cipher {
|
||||
card: Card;
|
||||
identity: Identity;
|
||||
|
||||
constructor(o?: CipherView) {
|
||||
if (o == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Use build method instead of ctor so that we can control order of JSON stringify for pretty print
|
||||
build(o: CipherView) {
|
||||
this.organizationId = o.organizationId;
|
||||
this.folderId = o.folderId;
|
||||
this.type = o.type;
|
||||
|
||||
@@ -9,15 +9,12 @@ export class Collection {
|
||||
return view;
|
||||
}
|
||||
|
||||
name: string;
|
||||
organizationId: string;
|
||||
name: string;
|
||||
|
||||
constructor(o?: CollectionView) {
|
||||
if (o == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.name = o.name;
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,8 @@ export class Folder {
|
||||
|
||||
name: string;
|
||||
|
||||
constructor(o?: FolderView) {
|
||||
if (o == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Use build method instead of ctor so that we can control order of JSON stringify for pretty print
|
||||
build(o: FolderView) {
|
||||
this.name = o.name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,9 @@ export class CipherResponse extends Cipher implements BaseResponse {
|
||||
id: string;
|
||||
|
||||
constructor(o: CipherView) {
|
||||
super(o);
|
||||
super();
|
||||
this.object = 'item';
|
||||
this.id = o.id;
|
||||
this.build(o);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,9 @@ export class CollectionResponse extends Collection implements BaseResponse {
|
||||
id: string;
|
||||
|
||||
constructor(o: CollectionView) {
|
||||
super(o);
|
||||
super();
|
||||
this.object = 'collection';
|
||||
this.id = o.id;
|
||||
this.build(o);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,9 @@ export class FolderResponse extends Folder implements BaseResponse {
|
||||
id: string;
|
||||
|
||||
constructor(o: FolderView) {
|
||||
super(o);
|
||||
super();
|
||||
this.object = 'folder';
|
||||
this.id = o.id;
|
||||
this.build(o);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user