nikcorg/funcalicious

View on GitHub
src/contains.js

Summary

Maintainability
A
0 mins
Test Coverage
export const contains = what => {
    if (!(Array.isArray(what) || typeof what === "string")) {
        throw new Error("Expected a string or an array");
    }

    return i => -1 < what.indexOf(i);
}