fix(yaml): update parser (#4931)

* test: add tests

* fix(yaml): update parser
master
Ika 2018-08-03 15:10:26 +08:00 committed by GitHub
parent 3b3240bdb8
commit 42ba638f37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 76 additions and 6 deletions

View File

@ -60,8 +60,8 @@
"typescript-eslint-parser": "17.0.0",
"unicode-regex": "1.0.1",
"unified": "6.1.6",
"yaml": "1.0.0-rc.7",
"yaml-unist-parser": "1.0.0-rc.3"
"yaml": "ikatyang/yaml#a765c1ee16d6b8a5e715564645f2b85f7e04828b",
"yaml-unist-parser": "ikatyang/yaml-unist-parser#cd4f73325b3fc02a6d17842d0d9cee0dfc729c9b"
},
"devDependencies": {
"@babel/cli": "7.0.0-beta.55",

View File

@ -94,6 +94,14 @@ A:
`;
exports[`in-empty-item-without-newlline.yml - yaml-verify 1`] = `
a:
#123~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a:
#123
`;
exports[`root.yml - yaml-verify 1`] = `
#hello world
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -0,0 +1,2 @@
a:
#123

View File

@ -206,6 +206,56 @@ key:
`;
exports[`merge-twice.yml - yaml-verify 1`] = `
.anchors:
- &anchor1
key: value
- &anchor2
another: prop
foo:
bar: baz
<<: *anchor1
<<: *anchor2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.anchors:
- &anchor1
key: value
- &anchor2
another: prop
foo:
bar: baz
<<: *anchor1
<<: *anchor2
`;
exports[`merge-twice.yml - yaml-verify 2`] = `
.anchors:
- &anchor1
key: value
- &anchor2
another: prop
foo:
bar: baz
<<: *anchor1
<<: *anchor2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.anchors:
- &anchor1
key: value
- &anchor2
another: prop
foo:
bar: baz
<<: *anchor1
<<: *anchor2
`;
exports[`middle-comment.yml - yaml-verify 1`] = `
!!map # comment
a: 123

View File

@ -0,0 +1,10 @@
.anchors:
- &anchor1
key: value
- &anchor2
another: prop
foo:
bar: baz
<<: *anchor1
<<: *anchor2

View File

@ -6086,16 +6086,16 @@ yallist@^3.0.0, yallist@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9"
yaml-unist-parser@1.0.0-rc.3:
yaml-unist-parser@ikatyang/yaml-unist-parser#cd4f73325b3fc02a6d17842d0d9cee0dfc729c9b:
version "1.0.0-rc.3"
resolved "https://registry.yarnpkg.com/yaml-unist-parser/-/yaml-unist-parser-1.0.0-rc.3.tgz#d7b396353da92c75bb471a9e65973ba967e0b4f6"
resolved "https://codeload.github.com/ikatyang/yaml-unist-parser/tar.gz/cd4f73325b3fc02a6d17842d0d9cee0dfc729c9b"
dependencies:
lines-and-columns "^1.1.6"
tslib "^1.9.1"
yaml@1.0.0-rc.7:
yaml@ikatyang/yaml#a765c1ee16d6b8a5e715564645f2b85f7e04828b:
version "1.0.0-rc.7"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.0.0-rc.7.tgz#7cf9dba3c78992542b7a2d7cb9a7eeacbff63f77"
resolved "https://codeload.github.com/ikatyang/yaml/tar.gz/a765c1ee16d6b8a5e715564645f2b85f7e04828b"
yargs-parser@^7.0.0:
version "7.0.0"