(props: {
context: ITypiaContext;
object: MetadataObjectType;
})
| 161 | }; |
| 162 | |
| 163 | const decode_object = (props: { |
| 164 | context: ITypiaContext; |
| 165 | object: MetadataObjectType; |
| 166 | }): ts.Statement[] => { |
| 167 | // const input: ts.Identifier = ts.factory.createIdentifier("input"); |
| 168 | const output: ts.Identifier = ts.factory.createIdentifier("output"); |
| 169 | return [ |
| 170 | StatementFactory.constant({ |
| 171 | name: "output", |
| 172 | value: ts.factory.createObjectLiteralExpression( |
| 173 | props.object.properties.map((p) => |
| 174 | decode_regular_property({ |
| 175 | context: props.context, |
| 176 | property: p, |
| 177 | }), |
| 178 | ), |
| 179 | true, |
| 180 | ), |
| 181 | }), |
| 182 | ts.factory.createReturnStatement( |
| 183 | ts.factory.createAsExpression(output, TypeFactory.keyword("any")), |
| 184 | ), |
| 185 | ]; |
| 186 | }; |
| 187 | |
| 188 | const decode_regular_property = (props: { |
| 189 | context: ITypiaContext; |
no test coverage detected
searching dependent graphs…