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.mjs 997B

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