1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

pretty print json

This commit is contained in:
Kyle Spearrin
2018-05-15 12:44:10 -04:00
parent 07cc64c0b8
commit 8e23842399
7 changed files with 50 additions and 35 deletions

View File

@@ -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;