Fix underscore tests for TS 2.4

A test in underscore mistakenly used the truthiness of _.identity as a
predicate for _.every, even though the predicate is supposed to return
boolean. The new code wraps _.identity in an arrow and prefixes a `!!`
to coerce truthy values to true.
This commit is contained in:
Nathan Shively-Sanders 2017-06-28 09:50:28 -07:00
parent c126a9ec44
commit c0ec19e2d0

View File

@ -156,7 +156,7 @@ _.where(listOfPlays, { author: "Shakespeare", year: 1611 });
var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0);
_.every([true, 1, null, 'yes'], _.identity);
_.every([true, 1, null, 'yes'], x => !!_.identity(x));
_.any([null, 0, 'yes', false]);