From 6b796258d413f00e498ce7f80f73a9f6c061f29c Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sat, 30 Mar 2024 23:40:33 +0100 Subject: Updated 5 files, added 2 files, deleted 495 files and renamed 7 files (automated) --- .../node_modules/axios/lib/helpers/throttle.js | 33 ---------------------- 1 file changed, 33 deletions(-) delete mode 100644 includes/external/signal/node_modules/axios/lib/helpers/throttle.js (limited to 'includes/external/signal/node_modules/axios/lib/helpers/throttle.js') diff --git a/includes/external/signal/node_modules/axios/lib/helpers/throttle.js b/includes/external/signal/node_modules/axios/lib/helpers/throttle.js deleted file mode 100644 index 6969df1..0000000 --- a/includes/external/signal/node_modules/axios/lib/helpers/throttle.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -/** - * Throttle decorator - * @param {Function} fn - * @param {Number} freq - * @return {Function} - */ -function throttle(fn, freq) { - let timestamp = 0; - const threshold = 1000 / freq; - let timer = null; - return function throttled(force, args) { - const now = Date.now(); - if (force || now - timestamp > threshold) { - if (timer) { - clearTimeout(timer); - timer = null; - } - timestamp = now; - return fn.apply(null, args); - } - if (!timer) { - timer = setTimeout(() => { - timer = null; - timestamp = Date.now(); - return fn.apply(null, args); - }, threshold - (now - timestamp)); - } - }; -} - -export default throttle; -- cgit