.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / utils / optionsMatches.js
1 /* @flow */
2 "use strict";
3
4 const matchesStringOrRegExp = require("./matchesStringOrRegExp");
5
6 /**
7  * Check if an options object's propertyName contains a user-defined string or
8  * regex that matches the passed in input.
9  */
10 module.exports = function optionsMatches(
11   options /*: Object*/,
12   propertyName /*: string*/,
13   input /*: string*/
14 ) /*: boolean*/ {
15   return !!(
16     options &&
17     options[propertyName] &&
18     typeof input === "string" &&
19     matchesStringOrRegExp(input, options[propertyName])
20   );
21 };