Replace isArray helper with native Array.isArray
This commit is contained in:
@@ -6,7 +6,7 @@ getJasmineRequireObj().ArrayContaining = function(j$) {
|
||||
}
|
||||
|
||||
ArrayContaining.prototype.asymmetricMatch = function(other, matchersUtil) {
|
||||
if (!j$.private.isArray(this.sample)) {
|
||||
if (!Array.isArray(this.sample)) {
|
||||
throw new Error(
|
||||
'You must provide an array to arrayContaining, not ' +
|
||||
j$.private.basicPrettyPrinter(this.sample) +
|
||||
@@ -17,7 +17,7 @@ getJasmineRequireObj().ArrayContaining = function(j$) {
|
||||
// If the actual parameter is not an array, we can fail immediately, since it couldn't
|
||||
// possibly be an "array containing" anything. However, we also want an empty sample
|
||||
// array to match anything, so we need to double-check we aren't in that case
|
||||
if (!j$.private.isArray(other) && this.sample.length > 0) {
|
||||
if (!Array.isArray(other) && this.sample.length > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ getJasmineRequireObj().ArrayWithExactContents = function(j$) {
|
||||
other,
|
||||
matchersUtil
|
||||
) {
|
||||
if (!j$.private.isArray(this.sample)) {
|
||||
if (!Array.isArray(this.sample)) {
|
||||
throw new Error(
|
||||
'You must provide an array to arrayWithExactContents, not ' +
|
||||
j$.private.basicPrettyPrinter(this.sample) +
|
||||
|
||||
@@ -6,7 +6,7 @@ getJasmineRequireObj().Empty = function(j$) {
|
||||
Empty.prototype.asymmetricMatch = function(other) {
|
||||
if (
|
||||
j$.private.isString(other) ||
|
||||
j$.private.isArray(other) ||
|
||||
Array.isArray(other) ||
|
||||
j$.private.isTypedArray(other)
|
||||
) {
|
||||
return other.length === 0;
|
||||
|
||||
@@ -6,7 +6,7 @@ getJasmineRequireObj().NotEmpty = function(j$) {
|
||||
NotEmpty.prototype.asymmetricMatch = function(other) {
|
||||
if (
|
||||
j$.private.isString(other) ||
|
||||
j$.private.isArray(other) ||
|
||||
Array.isArray(other) ||
|
||||
j$.private.isTypedArray(other)
|
||||
) {
|
||||
return other.length !== 0;
|
||||
|
||||
Reference in New Issue
Block a user