yaml 1.10.0 → 2.0.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -11
- package/browser/dist/Schema-ea978338.js +1211 -0
- package/browser/dist/{PlainValue-ff5147c6.js → errors-2634d01a.js} +8 -186
- package/browser/dist/index.js +1174 -121
- package/browser/dist/parse-cst.js +2 -1904
- package/browser/dist/parse-d1ba890f.js +2084 -0
- package/browser/dist/{resolveSeq-04825f30.js → stringifyNumber-d8af95b1.js} +197 -1072
- package/browser/dist/types.js +3 -4
- package/browser/dist/util.js +2 -2
- package/browser/index.js +1 -1
- package/dist/Document-f89a2614.js +1783 -0
- package/dist/Schema-807430ba.js +934 -0
- package/dist/{PlainValue-ec8e588e.js → _rollupPluginBabelHelpers-eed30217.js} +0 -167
- package/dist/index.js +58 -44
- package/dist/parse-3997f544.js +1915 -0
- package/dist/parse-cst.js +3 -1742
- package/dist/stringifyNumber-dea1120c.js +1286 -0
- package/dist/test-events.js +6 -7
- package/dist/types.js +16 -17
- package/dist/util.js +12 -14
- package/index.d.ts +103 -20
- package/index.js +1 -1
- package/package.json +16 -26
- package/types.d.ts +19 -47
- package/util.d.ts +2 -12
- package/util.js +0 -2
- package/util.mjs +0 -3
- package/browser/dist/Schema-2bf2c74e.js +0 -679
- package/browser/dist/legacy-exports.js +0 -3
- package/browser/dist/warnings-0e4b70d3.js +0 -499
- package/browser/map.js +0 -2
- package/browser/pair.js +0 -2
- package/browser/scalar.js +0 -2
- package/browser/schema.js +0 -9
- package/browser/seq.js +0 -2
- package/browser/types/binary.js +0 -8
- package/browser/types/omap.js +0 -3
- package/browser/types/pairs.js +0 -3
- package/browser/types/set.js +0 -3
- package/browser/types/timestamp.js +0 -10
- package/dist/Document-2cf6b08c.js +0 -757
- package/dist/Schema-42e9705c.js +0 -522
- package/dist/legacy-exports.js +0 -16
- package/dist/resolveSeq-4a68b39b.js +0 -2115
- package/dist/warnings-39684f17.js +0 -416
- package/map.js +0 -2
- package/pair.js +0 -2
- package/scalar.js +0 -2
- package/schema.js +0 -9
- package/seq.js +0 -2
- package/types/binary.js +0 -8
- package/types/omap.js +0 -3
- package/types/pairs.js +0 -3
- package/types/set.js +0 -3
- package/types/timestamp.js +0 -10
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# YAML <a href="https://www.npmjs.com/package/yaml"><img align="right" src="https://badge.fury.io/js/yaml.svg" title="npm package" /></a
|
|
1
|
+
# YAML <a href="https://www.npmjs.com/package/yaml"><img align="right" src="https://badge.fury.io/js/yaml.svg" title="npm package" /></a>
|
|
2
2
|
|
|
3
3
|
`yaml` is a JavaScript parser and stringifier for [YAML](http://yaml.org/), a human friendly data serialization standard. It supports both parsing and stringifying data using all versions of YAML, along with all common data schemas. As a particularly distinguishing feature, `yaml` fully supports reading and writing comments and blank lines in YAML documents.
|
|
4
4
|
|
|
@@ -11,10 +11,10 @@ For more information, see the project's documentation site: [**eemeli.org/yaml**
|
|
|
11
11
|
To install:
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
npm install yaml
|
|
14
|
+
npm install yaml@next
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Note
|
|
17
|
+
**Note:** These docs are for `yaml@2`. For v1, see the [v1.10.0 tag](https://github.com/eemeli/yaml/tree/v1.10.0) for the source and [eemeli.org/yaml/v1](https://eemeli.org/yaml/v1/) for the documentation.
|
|
18
18
|
|
|
19
19
|
## API Overview
|
|
20
20
|
|
|
@@ -28,21 +28,21 @@ const YAML = require('yaml')
|
|
|
28
28
|
|
|
29
29
|
### Parse & Stringify
|
|
30
30
|
|
|
31
|
-
- [`YAML.parse(str, options): value`](https://eemeli.org/yaml/#yaml-parse)
|
|
32
|
-
- [`YAML.stringify(value, options): string`](https://eemeli.org/yaml/#yaml-stringify)
|
|
31
|
+
- [`YAML.parse(str, reviver?, options?): value`](https://eemeli.org/yaml/#yaml-parse)
|
|
32
|
+
- [`YAML.stringify(value, replacer?, options?): string`](https://eemeli.org/yaml/#yaml-stringify)
|
|
33
33
|
|
|
34
34
|
### YAML Documents
|
|
35
35
|
|
|
36
|
-
- [`YAML.createNode(value, wrapScalars, tag): Node`](https://eemeli.org/yaml/#creating-nodes)
|
|
37
36
|
- [`YAML.defaultOptions`](https://eemeli.org/yaml/#options)
|
|
38
37
|
- [`YAML.Document`](https://eemeli.org/yaml/#yaml-documents)
|
|
39
|
-
- [`constructor(options)`](https://eemeli.org/yaml/#creating-documents)
|
|
38
|
+
- [`constructor(value, replacer?, options?)`](https://eemeli.org/yaml/#creating-documents)
|
|
40
39
|
- [`defaults`](https://eemeli.org/yaml/#options)
|
|
40
|
+
- [`#createNode(value, options?): Node`](https://eemeli.org/yaml/#creating-nodes)
|
|
41
41
|
- [`#anchors`](https://eemeli.org/yaml/#working-with-anchors)
|
|
42
42
|
- [`#contents`](https://eemeli.org/yaml/#content-nodes)
|
|
43
43
|
- [`#errors`](https://eemeli.org/yaml/#errors)
|
|
44
|
-
- [`YAML.parseAllDocuments(str, options): YAML.Document[]`](https://eemeli.org/yaml/#parsing-documents)
|
|
45
|
-
- [`YAML.parseDocument(str, options): YAML.Document`](https://eemeli.org/yaml/#parsing-documents)
|
|
44
|
+
- [`YAML.parseAllDocuments(str, options?): YAML.Document[]`](https://eemeli.org/yaml/#parsing-documents)
|
|
45
|
+
- [`YAML.parseDocument(str, options?): YAML.Document`](https://eemeli.org/yaml/#parsing-documents)
|
|
46
46
|
|
|
47
47
|
```js
|
|
48
48
|
import { Pair, YAMLMap, YAMLSeq } from 'yaml/types'
|
|
@@ -111,9 +111,8 @@ YAML.stringify([true, false, 'maybe', null])
|
|
|
111
111
|
YAML.stringify({ number: 3, plain: 'string', block: 'two\nlines\n' })
|
|
112
112
|
// `number: 3
|
|
113
113
|
// plain: string
|
|
114
|
-
// block:
|
|
114
|
+
// block: |
|
|
115
115
|
// two
|
|
116
|
-
//
|
|
117
116
|
// lines
|
|
118
117
|
// `
|
|
119
118
|
```
|