assertthat
Version:
assertthat provides fluent TDD.
22 lines (21 loc) • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertActualIsContainingAnyOf = void 0;
const assertArrayIsContainingAnyOfIterable_1 = require("../forArrays/assertArrayIsContainingAnyOfIterable");
const assertSetIsContainingAnyOfIterable_1 = require("../forSets/assertSetIsContainingAnyOfIterable");
const assertStringIsContainingAnyOfIterable_1 = require("../forStrings/assertStringIsContainingAnyOfIterable");
const errors_1 = require("../../errors");
const typedescriptor_1 = require("typedescriptor");
const assertActualIsContainingAnyOf = function (actual, expected) {
if ((0, typedescriptor_1.isString)(actual)) {
return (0, assertStringIsContainingAnyOfIterable_1.assertStringIsContainingAnyOfIterable)(actual, expected);
}
if ((0, typedescriptor_1.isArray)(actual)) {
return (0, assertArrayIsContainingAnyOfIterable_1.assertArrayIsContainingAnyOfIterable)(actual, expected);
}
if ((0, typedescriptor_1.isSet)(actual)) {
return (0, assertSetIsContainingAnyOfIterable_1.assertSetIsContainingAnyOfIterable)(actual, expected);
}
throw new errors_1.InvalidOperation();
};
exports.assertActualIsContainingAnyOf = assertActualIsContainingAnyOf;