matches.js 280 Bytes RawBlameHistoryPermalink 1 2 3 4 5 6 7 8 9 10 import assertString from './util/assertString'; export default function matches(str, pattern, modifiers) { assertString(str); if (Object.prototype.toString.call(pattern) !== '[object RegExp]') { pattern = new RegExp(pattern, modifiers); } return pattern.test(str); }