Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 494 Bytes

File metadata and controls

19 lines (16 loc) · 494 Bytes

Add parentheses to head of ExpressionStatement instead of the whole statement (#14077 by @fisker)

// Input
({}).toString.call(foo) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo);

// Prettier stable
({}.toString.call(foo) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo));

// Prettier main
({}).toString.call(foo.forEach) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo);