A Twitch.tv viewer reward and games system.
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.

14 lines
346 B

  1. 'use strict';
  2. module.exports = filter;
  3. function filter(name, str, options) {
  4. if (typeof filter[name] === 'function') {
  5. var res = filter[name](str, options);
  6. } else {
  7. throw new Error('unknown filter ":' + name + '"');
  8. }
  9. return res;
  10. }
  11. filter.exists = function (name, str, options) {
  12. return typeof filter[name] === 'function';
  13. };