Skip to content

Commit

Permalink
Conform to style guide for coercion of Booleans
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Oct 26, 2021
1 parent d14295e commit 7fca70e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/format-library/src/link/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ export function getFormatBoundary(
type: format.type,
} );

if ( Boolean( formatAtStart ) ) {
if ( !! formatAtStart ) {
// Set values to conform to "start"
targetFormat = formatAtStart;
initialIndex = startIndex;
} else if ( Boolean( formatAtEnd ) ) {
} else if ( !! formatAtEnd ) {
// Set values to conform to "end"
targetFormat = formatAtEnd;
initialIndex = endIndex;
} else if ( Boolean( formatAtEndMinusOne ) ) {
} else if ( !! formatAtEndMinusOne ) {
// This is an edge case which will occur if you create a format, then place
// the caret just before the format and hit the back ARROW key. The resulting
// value object will have start and end +1 beyond the edge of the format boundary.
Expand Down

0 comments on commit 7fca70e

Please sign in to comment.