import escapeRegExp from './escapeRegExp';
/**
 * Generate a RegExp with a string parameter.
 * @param s The string to match.
 * @param type How to match.
 * @param flags Standard RegExp flags.
 * @returns A RegExp with the match pattern.
 */
const createStringMatcher = (s, type = 'contains', flags = 'i') => {
    const escaped = escapeRegExp(s);
    let pattern = escaped;
    if (type === 'exact') {
        pattern = `^${escaped}$`;
    }
    else if (type === 'start') {
        pattern = `^${escaped}`;
    }
    else if (type === 'boundary') {
        pattern = `(?:^|\\s)${escaped}`;
    }
    return new RegExp(pattern, flags);
};
export default createStringMatcher;
//# sourceMappingURL=createStringMatcher.js.map