node/tools/eslint/node_modules/comment-parser/es6/stringifier/index.js
Michaël Zasso 2eff28fb7a
tools: move ESLint to tools/eslint
Greatly simplify how ESLint and its plugins are installed.

PR-URL: https://github.com/nodejs/node/pull/53413
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-06-19 19:54:08 +00:00

17 lines
454 B
JavaScript

function join(tokens) {
return (tokens.start +
tokens.delimiter +
tokens.postDelimiter +
tokens.tag +
tokens.postTag +
tokens.type +
tokens.postType +
tokens.name +
tokens.postName +
tokens.description +
tokens.end +
tokens.lineEnd);
}
export default function getStringifier() {
return (block) => block.source.map(({ tokens }) => join(tokens)).join('\n');
}