1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 17:53:39 +00:00

move export models to jslib

This commit is contained in:
Kyle Spearrin
2018-12-17 10:29:37 -05:00
parent 27566c3fd5
commit 94f103c474
12 changed files with 458 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import { FieldType } from '../../enums/fieldType';
import { FieldView } from '../view/fieldView';
export class Field {
static template(): Field {
const req = new Field();
req.name = 'Field name';
req.value = 'Some value';
req.type = FieldType.Text;
return req;
}
static toView(req: Field, view = new FieldView()) {
view.type = req.type;
view.value = req.value;
view.name = req.name;
return view;
}
name: string;
value: string;
type: FieldType;
constructor(o?: FieldView) {
if (o == null) {
return;
}
this.name = o.name;
this.value = o.value;
this.type = o.type;
}
}