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.

tmpl.js 564B

1234567891011121314151617
  1. var INTERPOLATE = /{([^{]+?)}/g
  2. module.exports = function(str, data) {
  3. var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
  4. 'with(obj||{}){__p.push(\'' +
  5. str.replace(/\\/g, '\\\\')
  6. .replace(/'/g, "\\'")
  7. .replace(INTERPOLATE, function(match, code) {
  8. return "'," + code.replace(/\\'/g, "'") + ",'"
  9. })
  10. .replace(/\r/g, '\\r')
  11. .replace(/\n/g, '\\n')
  12. .replace(/\t/g, '\\t')
  13. + "');}return __p.join('');"
  14. var func = new Function('obj', tmpl)
  15. return data ? func(data) : func
  16. }