Skip to content

Commit 2164e04

Browse files
chore: Remove 2 unnecessary type casts (#154)
1 parent af5c7f7 commit 2164e04

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/parser.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type {
33
Backreference,
44
CapturingGroup,
55
CharacterClass,
6-
CharacterClassElement,
76
CharacterClassRange,
87
Flags,
98
Group,
@@ -393,7 +392,7 @@ class RegExpParserState {
393392
throw new Error("UnknownError")
394393
}
395394

396-
;(parent.elements as CharacterClassElement[]).push({
395+
parent.elements.push({
397396
type: "CharacterSet",
398397
parent,
399398
start,

src/validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ export class RegExpValidator {
642642
* @param options The options of validator.
643643
*/
644644
public constructor(options?: RegExpValidator.Options) {
645-
this._options = options ?? ({} as RegExpValidator.Options)
645+
this._options = options ?? {}
646646
}
647647

648648
/**

0 commit comments

Comments
 (0)