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.
21 lines
1.2 KiB
TypeScript
21 lines
1.2 KiB
TypeScript
// Loaded from https://deno.land/x/ramda@v0.27.2/source/internal/_arity.js
|
|
|
|
|
|
export default function _arity(n, fn) {
|
|
/* eslint-disable no-unused-vars */
|
|
switch (n) {
|
|
case 0: return function() { return fn.apply(this, arguments); };
|
|
case 1: return function(a0) { return fn.apply(this, arguments); };
|
|
case 2: return function(a0, a1) { return fn.apply(this, arguments); };
|
|
case 3: return function(a0, a1, a2) { return fn.apply(this, arguments); };
|
|
case 4: return function(a0, a1, a2, a3) { return fn.apply(this, arguments); };
|
|
case 5: return function(a0, a1, a2, a3, a4) { return fn.apply(this, arguments); };
|
|
case 6: return function(a0, a1, a2, a3, a4, a5) { return fn.apply(this, arguments); };
|
|
case 7: return function(a0, a1, a2, a3, a4, a5, a6) { return fn.apply(this, arguments); };
|
|
case 8: return function(a0, a1, a2, a3, a4, a5, a6, a7) { return fn.apply(this, arguments); };
|
|
case 9: return function(a0, a1, a2, a3, a4, a5, a6, a7, a8) { return fn.apply(this, arguments); };
|
|
case 10: return function(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) { return fn.apply(this, arguments); };
|
|
default: throw new Error('First argument to _arity must be a non-negative integer no greater than ten');
|
|
}
|
|
}
|