mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-19 20:45:35 +00:00
27 lines
729 B
JavaScript
27 lines
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).
|
|
'use strict';
|
|
|
|
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;
|