Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

utilsac

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utilsac - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

2

package.json
{
"name": "utilsac",
"version": "4.1.0",
"version": "4.2.0",
"description": "tools mostly",

@@ -5,0 +5,0 @@ "main": "files.js",

@@ -18,2 +18,3 @@ # Utilities and random js files

export {
createThrottledFunction,
createCustomRound,

@@ -20,0 +21,0 @@ fillArrayWithFunctionResult,

export {
createThrottledFunction,
createCustomRound,

@@ -11,2 +12,22 @@ fillArrayWithFunctionResult,

const createThrottledFunction = function (functionToThrottle, minimumTimeSpace) {
/* creates a function that is throttled,
calling it very often during a period less than minimumTimeSpace will only execute it once
an alternative implementation could use Date.now() , this means less performance
but would work for throttling inside a single tick
*/
let ready = true;
const makeReady = function() {
ready = true;
};
return function(...args) {
if (ready) {
ready = false;
functionToThrottle(...args);
timeout = setTimeout(makeReady, minimumTimeSpace);
}
};
};
const createCustomRound = function (precision) {

@@ -13,0 +34,0 @@ /* creates a function similar to Math.round (has precision of 1)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc