We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
assignTypeDerivedProperties
extendType
1 parent da108f2 commit fbb7939Copy full SHA for fbb7939
1 file changed
packages/command-flow/utilities/src/miscellaneous.ts
@@ -7,15 +7,15 @@ export function createPseudoType<T>(
7
return { [Symbol.hasInstance]: predicate } as any;
8
}
9
10
-export function assignTypeDerivedProperties<
+export function extendType<
11
T extends Type<any>,
12
- Extras extends Record<string, unknown>,
+ Extension extends Record<string, unknown>,
13
>(
14
type: T,
15
- derivation: (context: {
+ extension: (context: {
16
type: T;
17
$instance: TypeContainer<InstanceType<T>>;
18
- }) => Extras,
19
-): T & Extras {
20
- return Object.assign(type, derivation({ type, $instance: $type() }));
+ }) => Extension,
+): T & Extension {
+ return Object.assign(type, extension({ type, $instance: $type() }));
21
0 commit comments