Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

optionsMatches.js 565B

12345678910111213141516171819202122
  1. 'use strict';
  2. const matchesStringOrRegExp = require('./matchesStringOrRegExp');
  3. /**
  4. * Check if an options object's propertyName contains a user-defined string or
  5. * regex that matches the passed in input.
  6. *
  7. * @param {{ [x: string]: any; }} options
  8. * @param {string} propertyName
  9. * @param {string} input
  10. *
  11. * @returns {boolean}
  12. */
  13. module.exports = function optionsMatches(options, propertyName, input) {
  14. return Boolean(
  15. options &&
  16. options[propertyName] &&
  17. typeof input === 'string' &&
  18. matchesStringOrRegExp(input, options[propertyName]),
  19. );
  20. };