Download node_modules/axios/lib/helpers/callbackify.js from BillAnll/my: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/spaces/BillAnll/my/resolve/main/node_modules/axios/lib/helpers/callbackify.js
- Command line
-
hf download hf://spaces/BillAnll/my/node_modules/axios/lib/helpers/callbackify.js
-
curl -L -o callbackify.js https://huggingface.co/spaces/BillAnll/my/resolve/main/node_modules/axios/lib/helpers/callbackify.js
417 Bytes
| 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; | |