Skip to content

Commit 2a83bcf

Browse files
Removed the YAML export
1 parent 0dfff52 commit 2a83bcf

File tree

6 files changed

+7
-266
lines changed

6 files changed

+7
-266
lines changed

docs/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ Classes & Methods
2727
- [`get()` method](refs.md#getref-options)
2828
- [`set()` method](refs.md#setref-value-options)
2929

30-
#### [The `YAML` object](yaml.md)
31-
- [`parse()` method](yaml.md#parsetext)
32-
- [`stringify()` method](yaml.md#stringifyvalue)
33-
3430
#### [The `Options` object](options.md)
3531

3632

docs/yaml.md

Lines changed: 0 additions & 84 deletions
This file was deleted.

lib/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const maybe = require("call-me-maybe");
1313
const { ono } = require("@jsdevtools/ono");
1414

1515
module.exports = $RefParser;
16-
module.exports.YAML = require("./util/yaml");
1716
module.exports.JSONParserError = JSONParserError;
1817
module.exports.InvalidPointerError = InvalidPointerError;
1918
module.exports.MissingPointerError = MissingPointerError;

lib/parsers/yaml.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
const YAML = require("../util/yaml");
3+
const { parseWithPointers } = require("@stoplight/yaml");
44
const { StoplightParserError } = require("../util/errors");
55

66
module.exports = {
@@ -44,7 +44,12 @@ module.exports = {
4444
}
4545

4646
if (typeof data === "string") {
47-
let result = YAML.parse(data);
47+
let result = parseWithPointers(data, {
48+
json: true,
49+
mergeKeys: true,
50+
ignoreDuplicateKeys: false,
51+
});
52+
4853
if (StoplightParserError.hasErrors(result.diagnostics)) {
4954
throw new StoplightParserError(result.diagnostics, file.url);
5055
}

lib/util/yaml.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

test/specs/yaml.spec.js

Lines changed: 0 additions & 138 deletions
This file was deleted.

0 commit comments

Comments
 (0)