UNPKG

el-beeswarm

Version:

<div style="display: flex; padding: 1rem; flex-direction: column; align-items: center; justify-content: center; height: 100vh; text-align: center; display: flex;

28 lines (21 loc) 629 B
'use strict' function sliceChunks(chunks, token) { var startIndex = token.start._index var startBufferIndex = token.start._bufferIndex var endIndex = token.end._index var endBufferIndex = token.end._bufferIndex var view if (startIndex === endIndex) { view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)] } else { view = chunks.slice(startIndex, endIndex) if (startBufferIndex > -1) { view[0] = view[0].slice(startBufferIndex) } if (endBufferIndex > 0) { view.push(chunks[endIndex].slice(0, endBufferIndex)) } } return view } module.exports = sliceChunks