JSON booleans are more likely to be a JSON::PP::Boolean, as that is the result
of the true, false subs in all (current releases) of the three backends
Revision history for JSON-MaybeXS
+ - slight speed optimization for is_bool()
+
1.004003 - 2020-11-13
- fix another test that fails when JSON::XS is installed, but below version 3.0
die 'is_bool is not a method' if $_[1];
Scalar::Util::blessed($_[0])
- and ($_[0]->isa('JSON::XS::Boolean')
+ and ($_[0]->isa('JSON::PP::Boolean')
or $_[0]->isa('Cpanel::JSON::XS::Boolean')
- or $_[0]->isa('JSON::PP::Boolean'));
+ or $_[0]->isa('JSON::XS::Boolean'));
}
# (mostly) CopyPasta from JSON.pm version 2.90