File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export namespace Vault {
19
19
}
20
20
21
21
export async function encrypt ( text : string ) {
22
- const plaintext = new Buffer ( text ) . toString ( 'base64' )
22
+ const plaintext = Buffer . from ( text ) . toString ( 'base64' )
23
23
const encrypted = await this . vault . write ( 'transit/encrypt/frost' , {
24
24
plaintext,
25
25
} )
@@ -30,7 +30,7 @@ export namespace Vault {
30
30
const decrypted = await this . vault . write ( 'transit/decrypt/frost' , {
31
31
ciphertext,
32
32
} )
33
- return new Buffer ( decrypted . data . plaintext , 'base64' ) . toString ( 'ascii' )
33
+ return Buffer . from ( decrypted . data . plaintext , 'base64' ) . toString ( 'ascii' )
34
34
}
35
35
36
36
export async function createToken ( options ?: object ) {
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ describe('Works', function() {
109
109
const { token } = user
110
110
const { apiToken } = await frost . createApiToken ( token , Network . LIVE )
111
111
112
- const contentBuffer = new Buffer ( 1024 * 100 )
112
+ const contentBuffer = Buffer . alloc ( 1024 * 100 )
113
113
const content = contentBuffer . toString ( )
114
114
115
115
await expect ( frost . createWork ( apiToken , createWork ( { content } ) ) )
You can’t perform that action at this time.
0 commit comments