defered-branch 2.2.3 → 2.2.4

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/README.md CHANGED
@@ -17,6 +17,8 @@ For more awesome packages, check out [my homepage💛](https://baendlorel.github
17
17
 
18
18
  ## Features
19
19
 
20
+ <a id="features"></a>
21
+
20
22
  - 🎯 **Four Execution Patterns**: Single/all-match × immediate/dynamic logic
21
23
  - 🔒 **Type Safe**: Full TypeScript support with type inference
22
24
  - 🪶 **Lightweight**: Zero dependencies, minimal footprint
@@ -25,6 +27,8 @@ For more awesome packages, check out [my homepage💛](https://baendlorel.github
25
27
 
26
28
  ## Change Log
27
29
 
30
+ <a id="change-log"></a>
31
+
28
32
  - 2.2.1-2.2.3
29
33
  - Fix: Clear matched branch after execution to prevent stale state issues.
30
34
  - Add index to this document.
@@ -35,6 +39,8 @@ For more awesome packages, check out [my homepage💛](https://baendlorel.github
35
39
 
36
40
  ## Installation
37
41
 
42
+ <a id="installation"></a>
43
+
38
44
  ```bash
39
45
  npm install defered-branch
40
46
  # or
@@ -43,6 +49,8 @@ pnpm add defered-branch
43
49
 
44
50
  ## Overview
45
51
 
52
+ <a id="overview"></a>
53
+
46
54
  ### `deferedBranch` - Single-Match Immediate 🏃‍♂️
47
55
 
48
56
  Evaluate conditions once, execute first match immediately.
@@ -69,6 +77,8 @@ Reusable branching logic, execute all matches dynamically.
69
77
 
70
78
  ## Usage Examples
71
79
 
80
+ <a id="usage-examples"></a>
81
+
72
82
  ### Basic `deferedBranch`
73
83
 
74
84
  ```typescript
@@ -206,6 +216,8 @@ function h<T extends HTMLTag>(
206
216
 
207
217
  ## API Reference
208
218
 
219
+ <a id="api-reference"></a>
220
+
209
221
  ### deferedBranch()
210
222
 
211
223
  Creates a new deferred branch instance for immediate execution scenarios.
@@ -268,6 +280,8 @@ _Same as deferedBranchDynamic_
268
280
 
269
281
  ## Type Annotation
270
282
 
283
+ <a id="type-annotation"></a>
284
+
271
285
  The factory functions `deferedBranch`, `deferedBranchDynamic`, `deferedBranchAll`, and `deferedBranchAllDynamic` are generic helpers. You can provide explicit type parameters to describe the branch function signature and the optional `nomatch` handler.
272
286
 
273
287
  Below is an example using `deferedBranch`:
@@ -325,14 +339,20 @@ const result = calc.run(2, 3); // typed as number | undefined
325
339
 
326
340
  ## License
327
341
 
342
+ <a id="license"></a>
343
+
328
344
  MIT License - see [LICENSE](LICENSE) file for details.
329
345
 
330
346
  ## Contributing
331
347
 
348
+ <a id="contributing"></a>
349
+
332
350
  Contributions are welcome! Please feel free to submit issues and pull requests.
333
351
 
334
352
  ## Trivia
335
353
 
354
+ <a id="trivia"></a>
355
+
336
356
  [**KT.js**](https://www.npmjs.com/package/kt.js) is the reason of this package's birth. It uses `deferedBranchDynamic` internally to handle attribute and content processing in a clean, reusable way.
337
357
 
338
358
  ---
package/dist/index.d.ts CHANGED
@@ -138,7 +138,7 @@ declare class DeferedBranchAll<BranchFn extends AnyFn, NoMatchFn extends AnyFn>
138
138
  * ## About
139
139
  * @package DeferedBranch
140
140
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
141
- * @version 2.2.3 (Last Update: 2025.09.21 18:48:42.785)
141
+ * @version 2.2.4 (Last Update: 2025.09.21 18:53:18.840)
142
142
  * @license MIT
143
143
  * @link https://github.com/baendlorel/defered-branch
144
144
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -179,7 +179,7 @@ declare const deferedBranch: <BranchFn extends AnyFn = AnyFn, NoMatchFn extends
179
179
  * ## About
180
180
  * @package DeferedBranch
181
181
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
182
- * @version 2.2.3 (Last Update: 2025.09.21 18:48:42.785)
182
+ * @version 2.2.4 (Last Update: 2025.09.21 18:53:18.840)
183
183
  * @license MIT
184
184
  * @link https://github.com/baendlorel/defered-branch
185
185
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -213,7 +213,7 @@ declare const deferedBranchDynamic: <BranchFn extends AnyFn = AnyFn, NoMatchFn e
213
213
  * ## About
214
214
  * @package DeferedBranch
215
215
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
216
- * @version 2.2.3 (Last Update: 2025.09.21 18:48:42.785)
216
+ * @version 2.2.4 (Last Update: 2025.09.21 18:53:18.840)
217
217
  * @license MIT
218
218
  * @link https://github.com/baendlorel/defered-branch
219
219
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -254,7 +254,7 @@ declare const deferedBranchAll: <BranchFn extends AnyFn = AnyFn, NoMatchFn exten
254
254
  * ## About
255
255
  * @package DeferedBranch
256
256
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
257
- * @version 2.2.3 (Last Update: 2025.09.21 18:48:42.785)
257
+ * @version 2.2.4 (Last Update: 2025.09.21 18:53:18.840)
258
258
  * @license MIT
259
259
  * @link https://github.com/baendlorel/defered-branch
260
260
  * @link https://baendlorel.github.io/ Welcome to my site!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "defered-branch",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "author": {
5
5
  "name": "Kasukabe Tsumugi",
6
6
  "email": "futami16237@gmail.com"