Skip to content

Commit

Permalink
fix: use is-buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed May 2, 2019
1 parent 3c8b8eb commit bbf5baf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"license": "MIT",
"dependencies": {
"buffer": "^5.2.1",
"is-buffer": "^2.0.3",
"is-electron": "^2.2.0",
"is-pull-stream": "^0.0.0",
"is-stream": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/files/add-input-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
const kindOf = require('kind-of')
const isStream = require('is-stream')
const { isSource } = require('is-pull-stream')
const { Buffer } = require('buffer')
const isBuffer = require('is-buffer')

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

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

0 comments on commit bbf5baf

Please sign in to comment.