MCPcopy Create free account
hub / github.com/callstackincubator/polygen / processEntity

Function processEntity

packages/codegen/src/codegen/utils.ts:29–41  ·  view source on GitHub ↗
(entity: ModuleEntity)

Source from the content-addressed store, hash-verified

27 * @param entity Raw ModuleEntity
28 */
29export function processEntity(entity: ModuleEntity): GeneratedEntity {
30 switch (entity.kind) {
31 case 'function':
32 const returnType = matchW2CRType(entity.resultTypes[0]);
33 return {
34 ...entity,
35 parameterTypeNames: entity.parametersTypes.map(matchW2CRType),
36 returnTypeName: returnType,
37 };
38 default:
39 return entity;
40 }
41}
42
43/**
44 * Builds a GeneratedSymbol from ModuleImport or ModuleExport.

Callers 1

buildGeneratedSymbolFunction · 0.85

Calls 1

matchW2CRTypeFunction · 0.85

Tested by

no test coverage detected