Download node_modules/axios/lib/helpers/spread.js from kirimdata369/task-manager-pro: direct link, hf CLI and curl.
- Browser
- Download file 566 Bytes
-
https://huggingface.co/spaces/kirimdata369/task-manager-pro/resolve/main/node_modules/axios/lib/helpers/spread.js
- Command line
-
hf download hf://spaces/kirimdata369/task-manager-pro/node_modules/axios/lib/helpers/spread.js
-
curl -L -o spread.js https://huggingface.co/spaces/kirimdata369/task-manager-pro/resolve/main/node_modules/axios/lib/helpers/spread.js
566 Bytes
| ; | |
| /** | |
| * Syntactic sugar for invoking a function and expanding an array for arguments. | |
| * | |
| * Common use case would be to use `Function.prototype.apply`. | |
| * | |
| * ```js | |
| * function f(x, y, z) {} | |
| * const args = [1, 2, 3]; | |
| * f.apply(null, args); | |
| * ``` | |
| * | |
| * With `spread` this example can be re-written. | |
| * | |
| * ```js | |
| * spread(function(x, y, z) {})([1, 2, 3]); | |
| * ``` | |
| * | |
| * @param {Function} callback | |
| * | |
| * @returns {Function} | |
| */ | |
| export default function spread(callback) { | |
| return function wrap(arr) { | |
| return callback.apply(null, arr); | |
| }; | |
| } | |