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.

slice-chunks.js 629B

123456789101112131415161718192021222324252627
  1. 'use strict'
  2. function sliceChunks(chunks, token) {
  3. var startIndex = token.start._index
  4. var startBufferIndex = token.start._bufferIndex
  5. var endIndex = token.end._index
  6. var endBufferIndex = token.end._bufferIndex
  7. var view
  8. if (startIndex === endIndex) {
  9. view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]
  10. } else {
  11. view = chunks.slice(startIndex, endIndex)
  12. if (startBufferIndex > -1) {
  13. view[0] = view[0].slice(startBufferIndex)
  14. }
  15. if (endBufferIndex > 0) {
  16. view.push(chunks[endIndex].slice(0, endBufferIndex))
  17. }
  18. }
  19. return view
  20. }
  21. module.exports = sliceChunks