Skip to content

Commit

Permalink
Remove value from non-simple literals
Browse files Browse the repository at this point in the history
This removes the `value` property from regex and bigint literals.
  • Loading branch information
remcohaszing committed Jun 11, 2024
1 parent 3a370ff commit e25a9ad
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/estree-util-value-to-estree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function processNumber(number: bigint | number): Expression {
}

if (typeof number === 'bigint') {
return { type: 'Literal', value: number, bigint: String(number) }
return { type: 'Literal', bigint: String(number) }
}

if (number === Number.POSITIVE_INFINITY || Number.isNaN(number)) {
Expand Down Expand Up @@ -423,7 +423,6 @@ export function valueToEstree(value: unknown, options: Options = {}): Expression
if (val instanceof RegExp) {
return {
type: 'Literal',
value: val,
regex: { pattern: val.source, flags: val.flags }
}
}
Expand Down

0 comments on commit e25a9ad

Please sign in to comment.