Skip to content

Commit bbf5baf

Browse files
committed
fix: use is-buffer
1 parent 3c8b8eb commit bbf5baf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"license": "MIT",
2828
"dependencies": {
2929
"buffer": "^5.2.1",
30+
"is-buffer": "^2.0.3",
3031
"is-electron": "^2.2.0",
3132
"is-pull-stream": "^0.0.0",
3233
"is-stream": "^2.0.0",

src/files/add-input-validation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
const kindOf = require('kind-of')
44
const isStream = require('is-stream')
55
const { isSource } = require('is-pull-stream')
6-
const { Buffer } = require('buffer')
6+
const isBuffer = require('is-buffer')
77

88
const validateAddInput = (input) => {
99
// Buffer|ReadableStream|PullStream|File
10-
const isPrimitive = obj => Buffer.isBuffer(obj) || isStream.readable(obj) || isSource(obj) || kindOf(obj) === 'file'
10+
const isPrimitive = obj => isBuffer(obj) || isStream.readable(obj) || isSource(obj) || kindOf(obj) === 'file'
1111

1212
// An object like { content?, path? }, where content isBufferOrStream and path isString
1313
const isContentObject = obj => {

0 commit comments

Comments
 (0)