(userCall)
| 20861 | if (options && typeof options.leading === "boolean") leading = options.leading; |
| 20862 | if (options && typeof options.trailing === "boolean") trailing = options.trailing; |
| 20863 | var callback = function(userCall) { |
| 20864 | var now = Date.now(); |
| 20865 | var delta = now - lastExecuteTime; |
| 20866 | var waitLength = leading ? waitMS - delta : waitMS; |
| 20867 | if (delta >= waitMS && (!userCall || leading)) { |
| 20868 | lastExecuteTime = now; |
| 20869 | if (timeoutId) { |
| 20870 | _this.clearTimeout(timeoutId); |
| 20871 | timeoutId = null; |
| 20872 | } |
| 20873 | lastResult = func.apply(_this._parent, lastArgs); |
| 20874 | } else if (timeoutId === null && trailing) timeoutId = _this.setTimeout(callback, waitLength); |
| 20875 | return lastResult; |
| 20876 | }; |
| 20877 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 20878 | var resultFunction = function() { |
| 20879 | var args = []; |
no test coverage detected