defered-branch 1.2.0 → 1.2.2
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 +3 -1
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,10 +90,12 @@ If no branch has been matched when this is called, the `handler` is invoked imme
|
|
|
90
90
|
|
|
91
91
|
Register a handler to be executed by `run()` if no branch matched. Unlike `nomatch`, this does not run immediately — it defers execution until `run()`.
|
|
92
92
|
|
|
93
|
-
### `run(): unknown`
|
|
93
|
+
### `run(...args: unknown): unknown`
|
|
94
94
|
|
|
95
95
|
Execute the matched branch and return its value. If no branch matched but a `deferedNomatch` handler was set, returns the handler's return value. Returns `undefined` if neither exists.
|
|
96
96
|
|
|
97
|
+
`args` will be passed to the matched branch or the `deferedNomatch` handler when they are invoked.
|
|
98
|
+
|
|
97
99
|
## Types & Distribution
|
|
98
100
|
|
|
99
101
|
- Types are included (`"types": "./dist/index.d.ts"` in package.json).
|
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ declare class DeferBranch {
|
|
|
35
35
|
* ## About
|
|
36
36
|
* @package DeferedBranch
|
|
37
37
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
38
|
-
* @version 1.2.
|
|
38
|
+
* @version 1.2.2 (Last Update: 2025.09.19 08:09:05.967)
|
|
39
39
|
* @license MIT
|
|
40
40
|
* @link https://github.com/baendlorel/defered-branch
|
|
41
41
|
* @description Sometimes we need to judge something with multiple cases, but the main job should be done later. So we have Defered Branch!
|
|
@@ -46,4 +46,4 @@ declare const deferedBranch: () => DeferBranch;
|
|
|
46
46
|
export { deferedBranch };
|
|
47
47
|
|
|
48
48
|
// # from: src/global.d.ts
|
|
49
|
-
type Fn = (...args:
|
|
49
|
+
type Fn = (...args: any[]) => any;
|