Skip to content

Commit

Permalink
chore: Remove 2 unnecessary type casts (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored Oct 2, 2023
1 parent af5c7f7 commit 2164e04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type {
Backreference,
CapturingGroup,
CharacterClass,
CharacterClassElement,
CharacterClassRange,
Flags,
Group,
Expand Down Expand Up @@ -393,7 +392,7 @@ class RegExpParserState {
throw new Error("UnknownError")
}

;(parent.elements as CharacterClassElement[]).push({
parent.elements.push({
type: "CharacterSet",
parent,
start,
Expand Down
2 changes: 1 addition & 1 deletion src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ export class RegExpValidator {
* @param options The options of validator.
*/
public constructor(options?: RegExpValidator.Options) {
this._options = options ?? ({} as RegExpValidator.Options)
this._options = options ?? {}
}

/**
Expand Down

0 comments on commit 2164e04

Please sign in to comment.