import { FolderView } from "../view/folderView" ; import { EncString } from "../domain/encString" ; import { Folder as FolderDomain } from "../domain/folder" ; export class Folder { static template ( ) { const req = new Folder ( ) ; req . name = "Folder name" ; return req ; } static toView ( req , view = new FolderView ( ) ) { view . name = req . name ; return view ; } static toDomain ( req , domain = new FolderDomain ( ) ) { domain . name = req . name != null ? new EncString ( req . name ) : null ; return domain ; } name : string ; build ( o ) { if ( o instanceof FolderView ) { this . name = o . name ; } else { this . name = o . name ?. encryptedString ; } } }