@statx/utils
Advanced tools
| exports.throttled=(t,e)=>{let l,n,o=0;const c=function(){var r=[].slice.call(arguments);const s=Date.now(),u=s-o;u>t?(e(...r),o=s):(n=r,l||(l=setTimeout(()=>{c(n),l=null},u)))};return c}; | ||
| //# sourceMappingURL=index.js.map |
+13
-6
| { | ||
| "name": "@statx/utils", | ||
| "version": "1.0.24", | ||
| "version": "1.0.27", | ||
| "private": false, | ||
@@ -26,6 +26,12 @@ "description": "Extry tiny smart statx manager", | ||
| "sideEffects": false, | ||
| "type": "module", | ||
| "main": "build/index.js", | ||
| "exports": { | ||
| "require": "./build/index.js", | ||
| "types": "./build/index.d.ts", | ||
| "default": "./build/index.modern.mjs" | ||
| }, | ||
| "main": "./build/index.js", | ||
| "module": "./build/index.module.js", | ||
| "unpkg": "./build/index.umd.js", | ||
| "types": "./build/index.d.ts", | ||
| "source": "./src/index.ts", | ||
| "types": "build/index.d.ts", | ||
| "files": [ | ||
@@ -37,4 +43,5 @@ "/package.json", | ||
| "scripts": { | ||
| "build": "rimraf ./build/ && npm run build:parcel && npm run build:types", | ||
| "build": "rimraf ./build/ && npm run build:mb", | ||
| "build:parcel": "parcel build --target=build", | ||
| "build:mb": "microbundle", | ||
| "build:types": "tsc", | ||
@@ -57,3 +64,3 @@ "test": "tsx src/index.test.ts", | ||
| }, | ||
| "gitHead": "440673193af97baf704add8491a8352596223cf3" | ||
| "gitHead": "7499f9feeba7c5d3f2181ee76c8cf06370cab2e0" | ||
| } |
+0
-4
@@ -1,3 +0,1 @@ | ||
| export const createMockFn = () => {} | ||
| export const throttled = /*#__PURE__*/ <F extends (...args: any[]) => any>(time: number, df: F): F => { | ||
@@ -21,4 +19,2 @@ let timer: any | ||
| }, diffTime) | ||
| } else { | ||
| console.log('тротлим') | ||
| } | ||
@@ -25,0 +21,0 @@ } |
| const t=()=>{},o=(t,o)=>{let e,n,s=0;const c=(...l)=>{const r=Date.now(),a=r-s;a>t?(o(...l),s=r):(n=l,e?console.log("тротлим"):e=setTimeout((()=>{c(n),e=null}),a))};return c};export{t as createMockFn,o as throttled}; | ||
| //# sourceMappingURL=index.js.map |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
3580
1.79%1
-50%29
-9.37%No
NaN