import AuthenticatorAdapterInterface from './AuthenticatorAdapterInterface'; import Authenticator from '../entity/Authenticator'; export default class AuthenticatorAdapter implements AuthenticatorAdapterInterface { adapt(json: any, instance: Authenticator): Authenticator { return instance; } prepare(instance: Authenticator): object { const object = { username: instance.username, password: instance.password, }; return object; } transformToEntity(json: any): Authenticator { return this.adapt(json, new Authenticator()); } transformToPayload(instance: Authenticator): any { return this.prepare(instance); } }