have-matching
v1.0.3
Published
Compare two values with various paramaters.
Downloads
9
Maintainers
Readme
have-matching
Compare two values with some options.
Install
npm install have-matching
Usage
const haveMatching = require("have-matching");
haveMatching("t5est", "tSet5")); // true
Tests
npm test
Examples
haveMatching("test", "tSet5")); // false
haveMatching("t5est", "tSet5")); // true
haveMatching(889, "988")); // true
haveMatching("test", "tSet/8", { onlyLetters: true })); // true
haveMatching("test", "tSet8", { onlyNumbers: true })); // false
haveMatching("abc889", "98xyz8", { onlyNumbers: true })); // true
haveMatching("test", "tesT", { caseSensitive: true })); // false
haveMatching("test8", "tSe8t//.", {
onlyNumbers: true,
onlyLetters: true,
})
); // true
haveMatching("test", ["te", "st"])); // false
haveMatching("test", ["tSet", "st"])); // true
haveMatching(8, ["88", "test"])); // false
haveMatching("test", "Test", { orderMatter: true })); // true
haveMatching("test8", "test8", {
orderMatter: true,
onlyNumbers: true,
caseSensitive: true,
onlyLetters: true,
})
); // true