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.

combine-extensions.js 1005B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. 'use strict'
  2. var hasOwnProperty = require('../constant/has-own-property.js')
  3. var chunkedSplice = require('./chunked-splice.js')
  4. var miniflat = require('./miniflat.js')
  5. function combineExtensions(extensions) {
  6. var all = {}
  7. var index = -1
  8. while (++index < extensions.length) {
  9. extension(all, extensions[index])
  10. }
  11. return all
  12. }
  13. function extension(all, extension) {
  14. var hook
  15. var left
  16. var right
  17. var code
  18. for (hook in extension) {
  19. left = hasOwnProperty.call(all, hook) ? all[hook] : (all[hook] = {})
  20. right = extension[hook]
  21. for (code in right) {
  22. left[code] = constructs(
  23. miniflat(right[code]),
  24. hasOwnProperty.call(left, code) ? left[code] : []
  25. )
  26. }
  27. }
  28. }
  29. function constructs(list, existing) {
  30. var index = -1
  31. var before = []
  32. while (++index < list.length) {
  33. ;(list[index].add === 'after' ? existing : before).push(list[index])
  34. }
  35. chunkedSplice(existing, 0, 0, before)
  36. return existing
  37. }
  38. module.exports = combineExtensions