File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,11 +28,3 @@ export function removeLeadingLineBreakOfFirstElement(delimiters: RegExpMatchArra
2828 return delimiters
2929}
3030
31- /**
32- * Add a new line before each occurence of a top level keyword after a new line
33- * @param {string } text Text to be processed
34- * @returns {string } processed text
35- */
36- export function addNewLineBeforeRootKeywords ( text : string ) : string {
37- return text . replace ( / \n [ ^ \s ] * : / g, "\n$&" )
38- }
Original file line number Diff line number Diff line change 11import { equal , throws } from "assert"
22
33import {
4- addNewLineBeforeRootKeywords ,
54 prependWhitespacesOnEachLine
65} from "../../lib"
76import { removeTrailingCharacters } from "../../util/yaml-util"
@@ -52,17 +51,3 @@ suite("Test prependWhitespacesOnEachLine", () => {
5251 } )
5352} )
5453
55- suite ( "Test addNewLineBeforeRootKeywords" , ( ) => {
56- test ( "should add an empty line before each top level keyword, but only if they appear after a new line" , ( ) => {
57- const actual = `data:
58- key: value
59- spec: value
60- `
61- const expected = `data:
62- key: value
63-
64- spec: value
65- `
66- equal ( addNewLineBeforeRootKeywords ( actual ) , expected )
67- } )
68- } )
You can’t perform that action at this time.
0 commit comments