yaml 2.3.0-1 → 2.3.0-3
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/browser/dist/nodes/Node.js +3 -1
- package/dist/nodes/Node.js +2 -0
- package/package.json +3 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { applyReviver } from '../doc/applyReviver.js';
|
|
2
|
-
import { NODE_TYPE } from './identity.js';
|
|
2
|
+
import { NODE_TYPE, isDocument } from './identity.js';
|
|
3
3
|
import { toJS } from './toJS.js';
|
|
4
4
|
|
|
5
5
|
class NodeBase {
|
|
@@ -15,6 +15,8 @@ class NodeBase {
|
|
|
15
15
|
}
|
|
16
16
|
/** A plain JavaScript representation of this node. */
|
|
17
17
|
toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
|
|
18
|
+
if (!isDocument(doc))
|
|
19
|
+
throw new TypeError('A document argument is required');
|
|
18
20
|
const ctx = {
|
|
19
21
|
anchors: new Map(),
|
|
20
22
|
doc,
|
package/dist/nodes/Node.js
CHANGED
|
@@ -17,6 +17,8 @@ class NodeBase {
|
|
|
17
17
|
}
|
|
18
18
|
/** A plain JavaScript representation of this node. */
|
|
19
19
|
toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
|
|
20
|
+
if (!identity.isDocument(doc))
|
|
21
|
+
throw new TypeError('A document argument is required');
|
|
20
22
|
const ctx = {
|
|
21
23
|
anchors: new Map(),
|
|
22
24
|
doc,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yaml",
|
|
3
|
-
"version": "2.3.0-
|
|
3
|
+
"version": "2.3.0-3",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"author": "Eemeli Aro <eemeli@gmail.com>",
|
|
6
6
|
"repository": "github:eemeli/yaml",
|
|
@@ -25,22 +25,17 @@
|
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
28
29
|
"node": "./dist/index.js",
|
|
29
30
|
"default": "./browser/index.js"
|
|
30
31
|
},
|
|
31
32
|
"./package.json": "./package.json",
|
|
32
33
|
"./util": {
|
|
34
|
+
"types": "./dist/util.d.ts",
|
|
33
35
|
"node": "./dist/util.js",
|
|
34
36
|
"default": "./browser/dist/util.js"
|
|
35
37
|
}
|
|
36
38
|
},
|
|
37
|
-
"typesVersions": {
|
|
38
|
-
"*": {
|
|
39
|
-
"*": [
|
|
40
|
-
"dist/*"
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
39
|
"scripts": {
|
|
45
40
|
"build": "npm run build:node && npm run build:browser",
|
|
46
41
|
"build:browser": "rollup -c config/rollup.browser-config.mjs",
|