Files
jasmine/src/core/asymmetric_equality/NotEmpty.js
2018-02-15 16:00:33 -08:00

27 lines
561 B
JavaScript

getJasmineRequireObj().NotEmpty = function (j$) {
function NotEmpty() {}
NotEmpty.prototype.asymmetricMatch = function (other) {
if (j$.isString_(other) || j$.isArray_(other) || j$.isTypedArray_(other)) {
return other.length !== 0;
}
if (j$.isMap(other) || j$.isSet(other)) {
return other.size !== 0;
}
if (j$.isObject_(other)) {
return Object.keys(other).length !== 0;
}
return false;
};
NotEmpty.prototype.jasmineToString = function () {
return '<jasmine.notEmpty>';
};
return NotEmpty;
};