index.js 454 B

1234567891011121314151617
  1. function join(tokens) {
  2. return (tokens.start +
  3. tokens.delimiter +
  4. tokens.postDelimiter +
  5. tokens.tag +
  6. tokens.postTag +
  7. tokens.type +
  8. tokens.postType +
  9. tokens.name +
  10. tokens.postName +
  11. tokens.description +
  12. tokens.end +
  13. tokens.lineEnd);
  14. }
  15. export default function getStringifier() {
  16. return (block) => block.source.map(({ tokens }) => join(tokens)).join('\n');
  17. }