UNPKG

vox-saver

Version:

Takes a JavaScript Object of .vox file data and returns a Byte Array with all the containing informations

11 lines (7 loc) 255 B
import unreadInt from "../unreadInt/unreadInt"; const writeString = (text : string) : number[] => { const textArray = text.split("") return [...unreadInt(textArray.length), ...textArray.map(char => char.charCodeAt(0))]; } export = writeString;