Skip to content

Commit

Permalink
[wework#243] move to yaml module for parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
pderaaij committed Jan 23, 2019
1 parent 85efdbd commit 9dd11cd
Show file tree
Hide file tree
Showing 5 changed files with 1,520 additions and 1,522 deletions.
6 changes: 3 additions & 3 deletions lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const fs = require('fs');
const path = require('path');
const rules = require('./rules.js');
const resolver = require('oas-resolver');
const yaml = require('js-yaml');
const yaml = require('yaml');

class ExtendableError extends Error {
constructor(message) {
Expand Down Expand Up @@ -97,7 +97,7 @@ const recursivelyLoadRulesets = async (ruleset, loadedRulesets, options) => {
}

try {
const data = yaml.safeLoad(text);
const data = yaml.parse(text);

loadedRulesets.push(ruleset);

Expand Down Expand Up @@ -156,7 +156,7 @@ const loadSpec = async (source, options = {}) => {
return await readSpecFile(source, options)
.then(content => {
try {
return yaml.safeLoad(content);
return yaml.parse(content);
} catch (err) {
throw new ReadError(err.message);
}
Expand Down
Loading

0 comments on commit 9dd11cd

Please sign in to comment.