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: support attr inherit #171

Merged
merged 2 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/ast/ts-ast-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
*/
import {
Node, MethodDeclaration, ShorthandPropertyAssignment, PropertyAssignment, ImportDeclaration, ClassDeclaration,
SourceFile, ObjectLiteralExpression
SourceFile, ObjectLiteralExpression, PropertyDeclaration, SyntaxKind, TypeGuards
} from 'ts-morph'
import { TypeGuards, SyntaxKind, PropertyDeclaration, ts } from 'ts-morph'
import { TagName } from '../models/component-info'
import { componentID, ComponentReference } from '../models/component-reference'
import { strongParseSanSourceFileOptions } from '../compilers/renderer-options'
Expand Down Expand Up @@ -57,9 +56,9 @@
return true
}

export function getPropertyStringValue<T extends string> (clazz: ClassDeclaration, memberName: string, defaultValue: T): T;

Check warning on line 59 in src/ast/ts-ast-util.ts

View workflow job for this annotation

GitHub Actions / Check (12)

This line has a length of 123. Maximum allowed is 120

Check warning on line 59 in src/ast/ts-ast-util.ts

View workflow job for this annotation

GitHub Actions / Check (14)

This line has a length of 123. Maximum allowed is 120

Check warning on line 59 in src/ast/ts-ast-util.ts

View workflow job for this annotation

GitHub Actions / Check (16)

This line has a length of 123. Maximum allowed is 120
export function getPropertyStringValue<T extends string> (clazz: ClassDeclaration, memberName: string): T | undefined;
export function getPropertyStringValue<T extends string> (clazz: ClassDeclaration, memberName: string, defaultValue?: T): T | undefined {

Check warning on line 61 in src/ast/ts-ast-util.ts

View workflow job for this annotation

GitHub Actions / Check (12)

This line has a length of 137. Maximum allowed is 120

Check warning on line 61 in src/ast/ts-ast-util.ts

View workflow job for this annotation

GitHub Actions / Check (14)

This line has a length of 137. Maximum allowed is 120

Check warning on line 61 in src/ast/ts-ast-util.ts

View workflow job for this annotation

GitHub Actions / Check (16)

This line has a length of 137. Maximum allowed is 120
const member = clazz.getProperty(memberName)
if (!member) return defaultValue

Expand Down
Loading