MCPcopy Create free account
hub / github.com/samchon/typia / decode_object

Function decode_object

packages/core/src/programmers/http/HttpQueryProgrammer.ts:186–227  ·  view source on GitHub ↗
(props: {
    context: ITypiaContext;
    object: MetadataObjectType;
  })

Source from the content-addressed store, hash-verified

184 };
185
186 const decode_object = (props: {
187 context: ITypiaContext;
188 object: MetadataObjectType;
189 }): ts.Statement[] => {
190 const input: ts.Identifier = ts.factory.createIdentifier("input");
191 const output: ts.Identifier = ts.factory.createIdentifier("output");
192
193 return [
194 ts.factory.createExpressionStatement(
195 ts.factory.createBinaryExpression(
196 input,
197 ts.factory.createToken(ts.SyntaxKind.EqualsToken),
198 ts.factory.createAsExpression(
199 ts.factory.createCallExpression(
200 props.context.importer.internal("httpQueryParseURLSearchParams"),
201 undefined,
202 [input],
203 ),
204 props.context.importer.type({
205 file: "typia",
206 name: "IReadableURLSearchParams",
207 }),
208 ),
209 ),
210 ),
211 StatementFactory.constant({
212 name: "output",
213 value: ts.factory.createObjectLiteralExpression(
214 props.object.properties.map((p) =>
215 decode_regular_property({
216 context: props.context,
217 property: p,
218 }),
219 ),
220 true,
221 ),
222 }),
223 ts.factory.createReturnStatement(
224 ts.factory.createAsExpression(output, TypeFactory.keyword("any")),
225 ),
226 ];
227 };
228
229 const decode_regular_property = (props: {
230 context: ITypiaContext;

Callers 1

decomposeFunction · 0.70

Calls 3

internalMethod · 0.80
typeMethod · 0.80
decode_regular_propertyFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…