Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/fourtyone11/origin-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'assets/node_modules/stylelint/lib/utils/optionsMatches.js')
-rw-r--r--assets/node_modules/stylelint/lib/utils/optionsMatches.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/assets/node_modules/stylelint/lib/utils/optionsMatches.js b/assets/node_modules/stylelint/lib/utils/optionsMatches.js
new file mode 100644
index 0000000..c0597e6
--- /dev/null
+++ b/assets/node_modules/stylelint/lib/utils/optionsMatches.js
@@ -0,0 +1,22 @@
+'use strict';
+
+const matchesStringOrRegExp = require('./matchesStringOrRegExp');
+
+/**
+ * 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 {string} input
+ *
+ * @returns {boolean}
+ */
+module.exports = function optionsMatches(options, propertyName, input) {
+ return Boolean(
+ options &&
+ options[propertyName] &&
+ typeof input === 'string' &&
+ matchesStringOrRegExp(input, options[propertyName]),
+ );
+};