| import utils from '../utils.js'; | |
| const callbackify = (fn, reducer) => { | |
| return utils.isAsyncFn(fn) | |
| ? function (...args) { | |
| const cb = args.pop(); | |
| fn.apply(this, args).then((value) => { | |
| try { | |
| reducer ? cb(null, ...reducer(value)) : cb(null, value); | |
| } catch (err) { | |
| cb(err); | |
| } | |
| }, cb); | |
| } | |
| : fn; | |
| }; | |
| export default callbackify; | |
Xet Storage Details
- Size:
- 417 Bytes
- Xet hash:
- 2310ce2d74ddf8e10f6f5dcab701c0b31daa2b3970097264c61db0e2df722bb8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.