SafeBuffer constructor fix for new pattern usage

This commit is contained in:
mhelander 2018-02-03 15:57:56 +02:00
parent 9b4c6089af
commit 07af08c699

2
sea.js
View File

@ -80,7 +80,7 @@
class SafeBuffer extends SeaArray {
constructor(...props) {
console.warn('new SafeBuffer() is depreciated, please use SafeBuffer.from()')
from = SafeBuffer.from
this.from = SafeBuffer.from
return SafeBuffer.from(...props)
}
// (data, enc) where typeof data === 'string' then enc === 'utf8'|'hex'|'base64'