mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
[SM-288] Rename models to follow naming convention (#3795)
This commit is contained in:
26
libs/common/src/models/view/password-history.view.ts
Normal file
26
libs/common/src/models/view/password-history.view.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Jsonify } from "type-fest";
|
||||
|
||||
import { Password } from "../domain/password";
|
||||
|
||||
import { View } from "./view";
|
||||
|
||||
export class PasswordHistoryView implements View {
|
||||
password: string = null;
|
||||
lastUsedDate: Date = null;
|
||||
|
||||
constructor(ph?: Password) {
|
||||
if (!ph) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.lastUsedDate = ph.lastUsedDate;
|
||||
}
|
||||
|
||||
static fromJSON(obj: Partial<Jsonify<PasswordHistoryView>>): PasswordHistoryView {
|
||||
const lastUsedDate = obj.lastUsedDate == null ? null : new Date(obj.lastUsedDate);
|
||||
|
||||
return Object.assign(new PasswordHistoryView(), obj, {
|
||||
lastUsedDate: lastUsedDate,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user