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

refactor: refactor types #230

Merged
merged 7 commits into from
Jan 12, 2024
Merged

refactor: refactor types #230

merged 7 commits into from
Jan 12, 2024

Conversation

D-Sketon
Copy link
Member

@D-Sketon D-Sketon commented Nov 4, 2023

No description provided.

@coveralls
Copy link

coveralls commented Nov 4, 2023

Pull Request Test Coverage Report for Build 7492170366

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 98.274%

Totals Coverage Status
Change from base Build 7431327401: 0.02%
Covered Lines: 4385
Relevant Lines: 4462

💛 - Coveralls

@D-Sketon
Copy link
Member Author

D-Sketon commented Nov 4, 2023

ref: hexojs/hexo#5271 (comment)

uiolee
uiolee previously approved these changes Dec 21, 2023
SukkaW
SukkaW previously approved these changes Dec 21, 2023
src/model.ts Outdated Show resolved Hide resolved
@D-Sketon D-Sketon dismissed stale reviews from SukkaW and uiolee via 2762d05 December 23, 2023 09:33
abstract _model: Model<T>;
_id!: string | number | undefined;
abstract _schema: Schema;
[key : string]: any;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how this can be modified to use the indexes in the generalized type.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 36 to 40
cast(value_: Exclude<unknown, null | undefined>, data?: unknown): I[];
cast(value_?: unknown, data?: unknown): I[] | null | undefined;
cast(value_?: unknown, data?: unknown): I[] | null | undefined {
value_ = super.cast(value_, data);
if (value_ == null) return value_ as null | undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO the type of SchemaType#cast should also be improved to avoid the as here.

uiolee
uiolee previously approved these changes Dec 28, 2023
@yoshinorin
Copy link
Member

yoshinorin commented Dec 29, 2023

Please submit a release PR if we need to release a new version after merge this PR.

@uiolee uiolee merged commit 2209f06 into hexojs:master Jan 12, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants