(
input: U & {
id: string;
projectId: string;
type: T;
config: InferNodeConfig<T>;
},
)
| 5 | |
| 6 | // This function signature ensures the config matches the type |
| 7 | export const checkNodeInput = < |
| 8 | T extends NodeType, |
| 9 | U extends Pick<Node, "projectId"> & Record<string, unknown>, |
| 10 | >( |
| 11 | input: U & { |
| 12 | id: string; |
| 13 | projectId: string; |
| 14 | type: T; |
| 15 | config: InferNodeConfig<T>; |
| 16 | }, |
| 17 | ): U & { type: T; config: object; hash: string } => { |
| 18 | const hash = hashNode(input); |
| 19 | return { |
| 20 | ...input, |
| 21 | config: input.config as object, |
| 22 | hash, |
| 23 | }; |
| 24 | }; |
no test coverage detected