We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e91e891 commit 0e00d89Copy full SHA for 0e00d89
src/internal/node/node-utf8.js
@@ -17,7 +17,6 @@
17
* limitations under the License.
18
*/
19
20
-import CombinedBuffer from '../buf/combined-buf'
21
import NodeBuffer from './node-buf'
22
import { newError } from '../../error'
23
import node from 'buffer'
@@ -30,9 +29,9 @@ function encode (str) {
30
29
}
31
32
function decode (buffer, length) {
33
- if (buffer instanceof NodeBuffer) {
+ if (Object.prototype.hasOwnProperty.call(buffer, '_buffer')) {
34
return decodeNodeBuffer(buffer, length)
35
- } else if (buffer instanceof CombinedBuffer) {
+ } else if (Object.prototype.hasOwnProperty.call(buffer, '_buffers')) {
36
return decodeCombinedBuffer(buffer, length)
37
} else {
38
throw newError(`Don't know how to decode strings from '${buffer}'`)
0 commit comments