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.

assert-method-exists.js 637B

12345678910111213141516171819
  1. "use strict";
  2. /**
  3. * Throws a TypeError when expected method doesn't exist
  4. *
  5. * @private
  6. * @param {*} value A value to examine
  7. * @param {string} method The name of the method to look for
  8. * @param {name} name A name to use for the error message
  9. * @param {string} methodPath The name of the method to use for error messages
  10. * @throws {TypeError} When the method doesn't exist
  11. */
  12. function assertMethodExists(value, method, name, methodPath) {
  13. if (value[method] === null || value[method] === undefined) {
  14. throw new TypeError(`Expected ${name} to have method ${methodPath}`);
  15. }
  16. }
  17. module.exports = assertMethodExists;