Skip to content

Commit

Permalink
Fix small stylistic issue
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed Jan 17, 2024
1 parent 2a2ecc2 commit 6d1cf82
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/estree-util-value-to-estree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,15 @@ export function valueToEstree(value: unknown, options: Options = {}): Expression
}

if (options.instanceAsObject || isPlainObject(value)) {
const properties = Reflect.ownKeys(value).map(
(key): Property => ({
type: 'Property',
method: false,
shorthand: false,
computed: typeof key !== 'string',
kind: 'init',
key: valueToEstree(key, options),
value: valueToEstree((value as Record<string | symbol, unknown>)[key], options)
})
)
const properties = Reflect.ownKeys(value).map<Property>((key) => ({
type: 'Property',
method: false,
shorthand: false,
computed: typeof key !== 'string',
kind: 'init',
key: valueToEstree(key, options),
value: valueToEstree((value as Record<string | symbol, unknown>)[key], options)
}))

if (Object.getPrototypeOf(value) == null) {
properties.unshift({
Expand Down

0 comments on commit 6d1cf82

Please sign in to comment.