Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: eemeli/yaml
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.7.1
Choose a base ref
...
head repository: eemeli/yaml
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.7.2
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Oct 15, 2019

  1. Copy the full SHA
    c029266 View commit details
  2. Update dependencies

    eemeli committed Oct 15, 2019
    Copy the full SHA
    32df150 View commit details
  3. 1.7.2

    eemeli committed Oct 15, 2019

    Verified

    This commit was signed with the committer’s verified signature.
    BobbyMcWho Bobby McDonald
    Copy the full SHA
    752d9e0 View commit details
Showing with 275 additions and 221 deletions.
  1. +243 −211 package-lock.json
  2. +10 −10 package.json
  3. +1 −0 src/schema/index.js
  4. +21 −0 tests/doc/stringify.js
454 changes: 243 additions & 211 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yaml",
"version": "1.7.1",
"version": "1.7.2",
"license": "ISC",
"author": "Eemeli Aro <eemeli@gmail.com>",
"repository": "github:eemeli/yaml",
@@ -67,25 +67,25 @@
"singleQuote": true
},
"devDependencies": {
"@babel/cli": "^7.5.5",
"@babel/core": "^7.5.5",
"@babel/cli": "^7.6.4",
"@babel/core": "^7.6.4",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-transform-runtime": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@babel/plugin-transform-runtime": "^7.6.2",
"@babel/preset-env": "^7.6.3",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-plugin-trace": "^1.1.0",
"common-tags": "^1.8.0",
"cpy-cli": "^2.0.0",
"eslint": "^6.2.2",
"eslint-config-prettier": "^6.1.0",
"eslint-plugin-prettier": "^3.1.0",
"fast-check": "^1.16.2",
"eslint": "^6.5.1",
"eslint-config-prettier": "^6.4.0",
"eslint-plugin-prettier": "^3.1.1",
"fast-check": "^1.17.0",
"jest": "^24.9.0",
"prettier": "^1.18.2"
},
"dependencies": {
"@babel/runtime": "^7.5.5"
"@babel/runtime": "^7.6.3"
},
"engines": {
"node": ">= 6"
1 change: 1 addition & 0 deletions src/schema/index.js
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ export default class Schema {
}

createNode(value, wrapScalars, tag, ctx) {
if (value instanceof Node) return value
let tagObj
if (tag) {
if (tag.startsWith('!!')) tag = Schema.defaultPrefix + tag.slice(2)
21 changes: 21 additions & 0 deletions tests/doc/stringify.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { source } from 'common-tags'
import YAML from '../../src/index'
import { stringifyString } from '../../src/stringify'
import { strOptions } from '../../src/tags/options'
@@ -366,3 +367,23 @@ describe('simple keys', () => {
)
})
})

test('eemeli/yaml#128: YAML node inside object', () => {
const seq = YAML.createNode(['a'])
seq.commentBefore = 'sc'
const map = YAML.createNode({ foo: 'bar', seq })
map.commentBefore = 'mc'
const obj = { array: [1], map }
expect(YAML.stringify(obj)).toBe(
source`
array:
- 1
map:
#mc
foo: bar
seq:
#sc
- a
` + '\n'
)
})