@aomex/commander
Advanced tools
Comparing version 0.0.12 to 0.0.13
# @aomex/commander | ||
## 0.0.13 | ||
### Patch Changes | ||
- [`d773432`](https://github.com/aomex/aomex/commit/d773432e1711d787c483553b3e2b0f667db71f01) Thanks [@geekact](https://github.com/geekact)! - feat(commander): logics can call each other | ||
## 0.0.12 | ||
@@ -4,0 +10,0 @@ |
@@ -14,6 +14,4 @@ import { ConsoleMiddlewareToken, ConsoleContext, ConsoleChain } from '@aomex/console'; | ||
mount?: T; | ||
logics?: Logics; | ||
action: (ctx: Props & Union2Intersection<CollectArrayType<T[number]>> & ConsoleContext, logic: { | ||
[K in keyof Logics]: Logics[K] extends (ctx: any, ...args: infer P) => infer R ? (...args: P) => R : never; | ||
}) => any; | ||
logics?: Logics & ThisType<Builder.ParsedLogicFunction<Logics>>; | ||
action: (ctx: Props & Union2Intersection<CollectArrayType<T[number]>> & ConsoleContext, logic: Builder.ParsedLogicFunction<Logics>) => any; | ||
} | ||
@@ -24,2 +22,5 @@ declare namespace Builder { | ||
} | ||
type ParsedLogicFunction<Logics extends object> = { | ||
[K in keyof Logics]: Logics[K] extends (ctx: any, ...args: infer P) => infer R ? (...args: P) => R : never; | ||
}; | ||
} | ||
@@ -26,0 +27,0 @@ declare class Builder<Props extends object = object, T extends ConsoleMiddlewareToken[] | [] = [], Logics extends Builder.LogicFunction<Props, T> = Builder.LogicFunction<Props, T>> { |
@@ -28,3 +28,3 @@ // src/commanders.ts | ||
Object.keys(options.logics).forEach((key) => { | ||
logics[key] = options.logics[key].bind(ctx); | ||
logics[key] = options.logics[key].bind(logics, ctx); | ||
}); | ||
@@ -31,0 +31,0 @@ } |
{ | ||
"name": "@aomex/commander", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25521
233