.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / utils / removeEmptyLinesBefore.js
1 /* @flow */
2 "use strict";
3
4 // Remove empty lines before a node. Mutates the node.
5 function removeEmptyLinesBefore(
6   node /*: postcss$node*/,
7   newline /*: '\n' | '\r\n'*/
8 ) /*: postcss$node*/ {
9   node.raws.before = node.raws.before.replace(/(\r?\n\s*\r?\n)+/g, newline);
10
11   return node;
12 }
13
14 module.exports = removeEmptyLinesBefore;