mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 20:22:26 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
37 lines
944 B
TypeScript
37 lines
944 B
TypeScript
// Loaded from https://deno.land/x/ramda@v0.27.2/source/unapply.js
|
|
|
|
|
|
import _curry1 from './internal/_curry1.js';
|
|
|
|
|
|
/**
|
|
* Takes a function `fn`, which takes a single array argument, and returns a
|
|
* function which:
|
|
*
|
|
* - takes any number of positional arguments;
|
|
* - passes these arguments to `fn` as an array; and
|
|
* - returns the result.
|
|
*
|
|
* In other words, `R.unapply` derives a variadic function from a function which
|
|
* takes an array. `R.unapply` is the inverse of [`R.apply`](#apply).
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.8.0
|
|
* @category Function
|
|
* @sig ([*...] -> a) -> (*... -> a)
|
|
* @param {Function} fn
|
|
* @return {Function}
|
|
* @see R.apply
|
|
* @example
|
|
*
|
|
* R.unapply(JSON.stringify)(1, 2, 3); //=> '[1,2,3]'
|
|
* @symb R.unapply(f)(a, b) = f([a, b])
|
|
*/
|
|
var unapply = _curry1(function unapply(fn) {
|
|
return function() {
|
|
return fn(Array.prototype.slice.call(arguments, 0));
|
|
};
|
|
});
|
|
export default unapply;
|