Skip to content

Commit d8e1b6b

Browse files
committed
Upgrade js-yaml to 4.x. Quoting changed.
1 parent a6c58e1 commit d8e1b6b

4 files changed

Lines changed: 57 additions & 19 deletions

File tree

package-lock.json

Lines changed: 51 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yaml-sort",
3-
"version": "1.0.6",
3+
"version": "1.1.0",
44
"description": "CLI tool to sort YAML files alphabetically",
55
"main": "yaml-sort.js",
66
"scripts": {
@@ -28,7 +28,7 @@
2828
},
2929
"homepage": "https://github.com/ddebin/yaml-sort#readme",
3030
"dependencies": {
31-
"js-yaml": "^3.14.1",
31+
"js-yaml": "^4.0.0",
3232
"yargs": "^15.0.0"
3333
},
3434
"devDependencies": {

test/test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test('CLI w/o arg', (t) => {
1616
test('CLI w/ arg', (t) => {
1717
const proc = spawn(t, '../yaml-sort.js --input test.yml --stdout', opts);
1818
proc.exitCode(0);
19-
proc.stdout.match('a: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit...\'\n' +
19+
proc.stdout.match('a: Lorem ipsum dolor sit amet, consectetur adipiscing elit...\n' +
2020
'b:\n' +
2121
' b: 35\n' +
2222
' c:\n' +
@@ -31,7 +31,7 @@ test('CLI --output', (t) => {
3131
' && cat output.yml' +
3232
' && rm -f output.yml', opts);
3333
proc.exitCode(0);
34-
proc.stdout.match('a: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit...\'\n' +
34+
proc.stdout.match('a: Lorem ipsum dolor sit amet, consectetur adipiscing elit...\n' +
3535
'b:\n' +
3636
' b: 35\n' +
3737
' c:\n' +
@@ -42,7 +42,7 @@ test('CLI --output', (t) => {
4242
test('CLI --indent', (t) => {
4343
const proc = spawn(t, '../yaml-sort.js --input test.yml --stdout --indent 4', opts);
4444
proc.exitCode(0);
45-
proc.stdout.match('a: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit...\'\n' +
45+
proc.stdout.match('a: Lorem ipsum dolor sit amet, consectetur adipiscing elit...\n' +
4646
'b:\n' +
4747
' b: 35\n' +
4848
' c:\n' +

yaml-sort.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ argv.input.forEach((file) => {
6868
try {
6969
const content = fs.readFileSync(file, 'utf8');
7070

71-
const sorted = yaml.safeDump(yaml.safeLoad(content), {
71+
const sorted = yaml.dump(yaml.load(content), {
7272
sortKeys: true,
7373
indent: argv.indent,
7474
lineWidth: argv.lineWidth,

0 commit comments

Comments
 (0)