Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 9353145

Browse files
check for promise according to spec
1 parent be96ce2 commit 9353145

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/block.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = (send) => {
99
put (file, cb) {
1010
if (Array.isArray(file)) {
1111
let err = new Error('block.put() only accepts 1 file')
12-
if (typeof cb !== 'function') {
12+
if (typeof cb !== 'function' && typeof Promise !== 'undefined') {
1313
return new Promise((resolve, reject) => reject(err))
1414
}
1515
return cb(err)

0 commit comments

Comments
 (0)