Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(generator): Add support for generating view models #550

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading