Skip to content

Commit

Permalink
Correct incorrect change
Browse files Browse the repository at this point in the history
  • Loading branch information
wagenet committed Sep 7, 2023
1 parent 8ea946a commit 5ae7d3a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/ember-truth-helpers/src/utils/truth-convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ export default function truthConvert<T extends string>(
): T extends '' ? false : true;
export default function truthConvert<T>(result: T): TruthConvert<T>;
export default function truthConvert(result: unknown): boolean {
const truthy =
result && typeof result === 'object' && 'isTruthy' in result
? result.isTruthy
: undefined;

if (typeof truthy === 'boolean') {
return truthy;
if (
typeof result === 'object' &&
result &&
'isTruthy' in result &&
typeof result.isTruthy === 'boolean'
) {
return result.isTruthy;
}

if (isArray(result)) {
Expand Down

0 comments on commit 5ae7d3a

Please sign in to comment.