( body: Function, ...pipeables: Array<any> )
| 1196 | |
| 1197 | /** @internal */ |
| 1198 | export const fnUntraced: Effect.fn.Untraced = ( |
| 1199 | body: Function, |
| 1200 | ...pipeables: Array<any> |
| 1201 | ) => { |
| 1202 | const fn = pipeables.length === 0 |
| 1203 | ? function(this: any) { |
| 1204 | return suspend(() => fromIteratorUnsafe(body.apply(this, arguments))) |
| 1205 | } |
| 1206 | : function(this: any) { |
| 1207 | let effect = suspend(() => fromIteratorUnsafe(body.apply(this, arguments))) |
| 1208 | for (let i = 0; i < pipeables.length; i++) { |
| 1209 | effect = pipeables[i](effect, ...arguments) |
| 1210 | } |
| 1211 | return effect |
| 1212 | } |
| 1213 | return defineFunctionLength(body.length, fn) |
| 1214 | } |
| 1215 | |
| 1216 | const defineFunctionLength = <F extends Function>(length: number, fn: F): F => |
| 1217 | Object.defineProperty(fn, "length", { |
no test coverage detected