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.

factory-space.js 546B

12345678910111213141516171819202122232425262728293031
  1. 'use strict'
  2. var markdownSpace = require('../character/markdown-space.js')
  3. function spaceFactory(effects, ok, type, max) {
  4. var limit = max ? max - 1 : Infinity
  5. var size = 0
  6. return start
  7. function start(code) {
  8. if (markdownSpace(code)) {
  9. effects.enter(type)
  10. return prefix(code)
  11. }
  12. return ok(code)
  13. }
  14. function prefix(code) {
  15. if (markdownSpace(code) && size++ < limit) {
  16. effects.consume(code)
  17. return prefix
  18. }
  19. effects.exit(type)
  20. return ok(code)
  21. }
  22. }
  23. module.exports = spaceFactory