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.

make_warning.js 710B

1234567891011121314151617181920212223
  1. var util = require("util")
  2. var messages = require("./warning_messages.json")
  3. module.exports = function() {
  4. var args = Array.prototype.slice.call(arguments, 0)
  5. var warningName = args.shift()
  6. if (warningName == "typo") {
  7. return makeTypoWarning.apply(null,args)
  8. }
  9. else {
  10. var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'"
  11. args.unshift(msgTemplate)
  12. return util.format.apply(null, args)
  13. }
  14. }
  15. function makeTypoWarning (providedName, probableName, field) {
  16. if (field) {
  17. providedName = field + "['" + providedName + "']"
  18. probableName = field + "['" + probableName + "']"
  19. }
  20. return util.format(messages.typo, providedName, probableName)
  21. }