Skip to content

Commit

Permalink
feat(generator): Add support for generating view models (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue authored Dec 4, 2023
1 parent bd487f8 commit f938c34
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/parser/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,13 @@ export function isRenderer(value: unknown) {
const is_object = typeof value === 'object';
if (!is_object) return false;
const keys = Reflect.ownKeys(value as object);
if (keys.length === 1 && keys[0].toString().includes('Renderer')) {
return Parser.sanitizeClassName(keys[0].toString());

if (keys.length === 1) {
const first_key = keys[0].toString();

if (first_key.endsWith('Renderer') || first_key.endsWith('Model')) {
return Parser.sanitizeClassName(first_key);
}
}
return false;
}
Expand Down

0 comments on commit f938c34

Please sign in to comment.