@alwatr/debounce 1.1.12 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/main.cjs +2 -2
- package/dist/main.mjs +2 -2
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.1.14](https://github.com/Alwatr/nanolib/compare/@alwatr/debounce@1.1.13...@alwatr/debounce@1.1.14) (2025-11-18)
|
|
7
|
+
|
|
8
|
+
### 🔨 Code Refactoring
|
|
9
|
+
|
|
10
|
+
* remove unnecessary type declarations from tsconfig.json files ([89bcc7d](https://github.com/Alwatr/nanolib/commit/89bcc7db839807110b80f8ba34414ea9734d9c75))
|
|
11
|
+
|
|
12
|
+
## [1.1.13](https://github.com/Alwatr/nanolib/compare/@alwatr/debounce@1.1.12...@alwatr/debounce@1.1.13) (2025-11-15)
|
|
13
|
+
|
|
14
|
+
### 🔗 Dependencies update
|
|
15
|
+
|
|
16
|
+
* bump the npm-dependencies group with 2 updates ([a80b84d](https://github.com/Alwatr/nanolib/commit/a80b84dada6c09b5e5621e7487c8ec13fff3c23a))
|
|
17
|
+
|
|
6
18
|
## [1.1.12](https://github.com/Alwatr/nanolib/compare/@alwatr/debounce@1.1.11...@alwatr/debounce@1.1.12) (2025-11-15)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @alwatr/debounce
|
package/dist/main.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** 📦 @alwatr/debounce v1.1.
|
|
2
|
-
__dev_mode__: console.debug("📦 @alwatr/debounce v1.1.
|
|
1
|
+
/** 📦 @alwatr/debounce v1.1.14 */
|
|
2
|
+
__dev_mode__: console.debug("📦 @alwatr/debounce v1.1.14");
|
|
3
3
|
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var main_exports={};__export(main_exports,{Debouncer:()=>Debouncer,createDebouncer:()=>createDebouncer});module.exports=__toCommonJS(main_exports);var Debouncer=class{constructor(config__){this.config__=config__;this.config__.trailing??=true;this.flush=this.flush.bind(this)}get isPending(){return this.timerId__!==void 0}trigger(...args){this.lastArgs__=args;const firstTrigger=!this.isPending;if(firstTrigger){if(this.config__.maxWait){this.maxWaitTimerId__=setTimeout(this.flush,this.config__.maxWait)}if(this.config__.leading===true){this.invoke__()}}else{clearTimeout(this.timerId__)}this.timerId__=setTimeout(()=>{if(this.config__.trailing===true){this.invoke__()}this.cleanup__()},this.config__.delay)}cancel(){if(this.timerId__){clearTimeout(this.timerId__)}if(this.maxWaitTimerId__){clearTimeout(this.maxWaitTimerId__)}this.cleanup__()}cleanup__(){delete this.timerId__;delete this.maxWaitTimerId__;delete this.lastArgs__}flush(){if(this.isPending){this.invoke__()}this.cancel()}invoke__(){if(this.lastArgs__){this.config__.func.apply(this.config__.thisContext,this.lastArgs__);this.lastArgs__=void 0}}};function createDebouncer(config){return new Debouncer(config)}0&&(module.exports={Debouncer,createDebouncer});
|
|
4
4
|
//# sourceMappingURL=main.cjs.map
|
package/dist/main.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** 📦 @alwatr/debounce v1.1.
|
|
2
|
-
__dev_mode__: console.debug("📦 @alwatr/debounce v1.1.
|
|
1
|
+
/** 📦 @alwatr/debounce v1.1.14 */
|
|
2
|
+
__dev_mode__: console.debug("📦 @alwatr/debounce v1.1.14");
|
|
3
3
|
var Debouncer=class{constructor(config__){this.config__=config__;this.config__.trailing??=true;this.flush=this.flush.bind(this)}get isPending(){return this.timerId__!==void 0}trigger(...args){this.lastArgs__=args;const firstTrigger=!this.isPending;if(firstTrigger){if(this.config__.maxWait){this.maxWaitTimerId__=setTimeout(this.flush,this.config__.maxWait)}if(this.config__.leading===true){this.invoke__()}}else{clearTimeout(this.timerId__)}this.timerId__=setTimeout(()=>{if(this.config__.trailing===true){this.invoke__()}this.cleanup__()},this.config__.delay)}cancel(){if(this.timerId__){clearTimeout(this.timerId__)}if(this.maxWaitTimerId__){clearTimeout(this.maxWaitTimerId__)}this.cleanup__()}cleanup__(){delete this.timerId__;delete this.maxWaitTimerId__;delete this.lastArgs__}flush(){if(this.isPending){this.invoke__()}this.cancel()}invoke__(){if(this.lastArgs__){this.config__.func.apply(this.config__.thisContext,this.lastArgs__);this.lastArgs__=void 0}}};function createDebouncer(config){return new Debouncer(config)}export{Debouncer,createDebouncer};
|
|
4
4
|
//# sourceMappingURL=main.mjs.map
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/debounce",
|
|
3
3
|
"description": "A powerful, modern, and type-safe debouncer utility designed for high-performance applications. It's framework-agnostic, works seamlessly in both Node.js and browsers, and provides a rich API for fine-grained control over function execution.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.14",
|
|
5
5
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
6
|
"bugs": "https://github.com/Alwatr/nanolib/issues",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@alwatr/nano-build": "6.3.
|
|
9
|
-
"@alwatr/prettier-config": "
|
|
10
|
-
"@alwatr/tsconfig-base": "6.0.
|
|
11
|
-
"@alwatr/type-helper": "6.1.
|
|
8
|
+
"@alwatr/nano-build": "6.3.9",
|
|
9
|
+
"@alwatr/prettier-config": "6.0.0",
|
|
10
|
+
"@alwatr/tsconfig-base": "6.0.4",
|
|
11
|
+
"@alwatr/type-helper": "6.1.7",
|
|
12
12
|
"@jest/globals": "^30.2.0",
|
|
13
|
-
"@types/node": "^24.10.
|
|
13
|
+
"@types/node": "^24.10.1",
|
|
14
14
|
"typescript": "^5.9.3"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"sideEffects": false,
|
|
81
81
|
"type": "module",
|
|
82
82
|
"types": "./dist/main.d.ts",
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "3c8ac8d51930dde05c5ed356ff384da47c1de89d"
|
|
84
84
|
}
|