MCPcopy Index your code
hub / github.com/alibaba/lowcode-engine / getShape

Function getShape

modules/material-parser/src/parse/ts/index.ts:212–234  ·  view source on GitHub ↗
(_type: ts.Type)

Source from the content-addressed store, hash-verified

210 }
211
212 function getShape(_type: ts.Type) {
213 const { symbol } = _type;
214 if (symbol && symbol.members) {
215 // @ts-ignore
216 const props: ts.Symbol[] = Array.from(symbol.members.values());
217 // if (props.length >= 20) {
218 // throw new Error('too many props');
219 // }
220 return getShapeFromArray(
221 props.filter((prop) => prop.getName() !== '__index'),
222 _type,
223 );
224 } else {
225 // @ts-ignore
226 const args = _type.resolvedTypeArguments || [];
227 const props = checker.getPropertiesOfType(_type);
228 // if (props.length >= 20) {
229 // throw new Error('too many props');
230 // }
231 const shape = getShapeFromArray(props.slice(0, args.length), _type);
232 return shape;
233 }
234 }
235
236 // @ts-ignore
237 if (type?.kind === SyntaxKind.VoidExpression) {

Callers 1

getDocgenTypeHelperFunction · 0.85

Calls 4

getShapeFromArrayFunction · 0.85
fromMethod · 0.65
filterMethod · 0.65
getNameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…