Skip to content

Commit 81a296d

Browse files
authored
fix: remove dupl check for typed arrays (#96)
1 parent 625526e commit 81a296d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async function writeFileAsync (filename, data, options = {}) {
108108
if (options.tmpfileCreated) {
109109
await options.tmpfileCreated(tmpfile)
110110
}
111-
if (Buffer.isBuffer(data) || ArrayBuffer.isView(data)) {
111+
if (ArrayBuffer.isView(data)) {
112112
await promisify(fs.write)(fd, data, 0, data.length, 0)
113113
} else if (data != null) {
114114
await promisify(fs.write)(fd, String(data), 0, String(options.encoding || 'utf8'))
@@ -210,7 +210,7 @@ function writeFileSync (filename, data, options) {
210210
if (options.tmpfileCreated) {
211211
options.tmpfileCreated(tmpfile)
212212
}
213-
if (Buffer.isBuffer(data) || ArrayBuffer.isView(data)) {
213+
if (ArrayBuffer.isView(data)) {
214214
fs.writeSync(fd, data, 0, data.length, 0)
215215
} else if (data != null) {
216216
fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8'))

0 commit comments

Comments
 (0)