defered-branch 1.1.0 → 1.2.0

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/dist/index.d.ts CHANGED
@@ -27,14 +27,15 @@ declare class DeferBranch {
27
27
  * If some branch matched, return its returnValue
28
28
  * - if no branch matched, return the nomatch handler returnValue
29
29
  * - if no branch matched and no nomatch handler, return undefined
30
+ * @param args arguments to pass to the matched branch or nomatch handler
30
31
  */
31
- run(): unknown;
32
+ run(...args: unknown[]): unknown;
32
33
  }
33
34
  /**
34
35
  * ## About
35
36
  * @package DeferedBranch
36
37
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
37
- * @version 1.1.0 (Last Update: 2025.09.19 07:53:15.059)
38
+ * @version 1.2.0 (Last Update: 2025.09.19 08:00:16.406)
38
39
  * @license MIT
39
40
  * @link https://github.com/baendlorel/defered-branch
40
41
  * @description Sometimes we need to judge something with multiple cases, but the main job should be done later. So we have Defered Branch!
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- class t{t=null;o=null;add(t,n){if("function"!=typeof n)throw new TypeError("Branch must be a function");return t&&(this.t=n),this}nomatch(t){if("function"!=typeof t)throw new TypeError("Branch must be a function");return this.t||t(),this}deferedNomatch(t){if("function"!=typeof t)throw new TypeError("Branch must be a function");return this.o=t,this}run(){return this.t?this.t():this.o?this.o():void 0}}const n=()=>new t;export{n as deferedBranch};
1
+ class t{t=null;o=null;add(t,n){if("function"!=typeof n)throw new TypeError("Branch must be a function");return t&&(this.t=n),this}nomatch(t){if("function"!=typeof t)throw new TypeError("Branch must be a function");return this.t||t(),this}deferedNomatch(t){if("function"!=typeof t)throw new TypeError("Branch must be a function");return this.o=t,this}run(...t){return this.t?this.t(...t):this.o?this.o(...t):void 0}}const n=()=>new t;export{n as deferedBranch};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "defered-branch",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "author": {
5
5
  "name": "Kasukabe Tsumugi",
6
6
  "email": "futami16237@gmail.com"