stylelint
Version:
A mighty CSS linter that helps you avoid errors and enforce conventions.
27 lines (23 loc) • 729 B
JavaScript
// NOTICE: This file is generated by Rollup. To modify it,
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
;
const matchesStringOrRegExp = require('./matchesStringOrRegExp.cjs');
/**
* Check if an options object's propertyName contains a user-defined string or
* regex that matches the passed in input.
*
* @param {{ [x: string]: any; }} options
* @param {string} propertyName
* @param {unknown} input
*
* @returns {boolean}
*/
function optionsMatches(options, propertyName, input) {
return Boolean(
options &&
options[propertyName] &&
typeof input === 'string' &&
matchesStringOrRegExp(input, options[propertyName]),
);
}
module.exports = optionsMatches;