File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @secjs/utils" ,
3- "version" : " 1.5.1 " ,
3+ "version" : " 1.5.2 " ,
44 "description" : " " ,
55 "license" : " MIT" ,
66 "author" : " João Lenon" ,
Original file line number Diff line number Diff line change @@ -99,10 +99,12 @@ export class File {
9999 )
100100 }
101101
102- toContract ( ) : FileContract {
102+ toContract ( buffer = false ) : FileContract {
103+ const value = this . getContentSync ( )
104+
103105 return {
104106 base : this . base ,
105- value : this . getContentSync ( ) . toString ( ) ,
107+ value : buffer ? value : value . toString ( ) ,
106108 }
107109 }
108110
Original file line number Diff line number Diff line change @@ -76,11 +76,11 @@ export class Folder {
7676 this . createFolderValues ( mockedValues )
7777 }
7878
79- toContract ( ) : DirectoryContract {
79+ toContract ( buffer = false ) : DirectoryContract {
8080 return {
8181 name : this . name ,
82- files : this . files . map ( file => file . toContract ( ) ) ,
83- folders : this . folders . map ( folder => folder . toContract ( ) ) ,
82+ files : this . files . map ( file => file . toContract ( buffer ) ) ,
83+ folders : this . folders . map ( folder => folder . toContract ( buffer ) ) ,
8484 }
8585 }
8686
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ declare global {
7070 isCopy ?: boolean ,
7171 )
7272
73- toContract ( ) : FileContract
73+ toContract ( buffer ?: boolean ) : FileContract
7474 toJSON ( ) : FileJsonContract
7575 createSync ( ) : File
7676 create ( ) : Promise < File >
@@ -202,7 +202,7 @@ declare global {
202202 */
203203 constructor ( folderPath : string , mockedValues ?: boolean , isCopy ?: boolean )
204204
205- toContract ( ) : DirectoryContract
205+ toContract ( buffer ?: boolean ) : DirectoryContract
206206 toJSON ( ) : FolderJsonContract
207207 createSync ( ) : Folder
208208 create ( ) : Promise < Folder >
You can’t perform that action at this time.
0 commit comments