mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-10 12:47:49 +00:00
feat: upgrade js-yaml package (#403)
* feat: upgraded js-yaml package from v.3 to v.4 with YAML 1.2 support * feat: removed timestamp type from YAML schema
This commit is contained in:
committed by
GitHub
parent
4cbd04ecae
commit
35fc48c667
@@ -1,9 +1,10 @@
|
||||
import { red, blue, yellow, green } from 'colorette';
|
||||
import * as fs from 'fs';
|
||||
import * as yaml from 'js-yaml';
|
||||
import { parseYaml } from '@redocly/openapi-core';
|
||||
import * as path from 'path';
|
||||
import { performance } from 'perf_hooks';
|
||||
const isEqual = require('lodash.isequal');
|
||||
|
||||
import { printExecutionTime, pathToFilename, readYaml, writeYaml, exitWithError } from '../../utils';
|
||||
import { isString, isObject, isEmptyObject } from '../../js-utils';
|
||||
import {
|
||||
@@ -71,7 +72,7 @@ function isNotYaml(filename: string) {
|
||||
|
||||
function loadFile(fileName: string) {
|
||||
try {
|
||||
return yaml.safeLoad(fs.readFileSync(fileName, 'utf8')) as Definition;
|
||||
return parseYaml(fs.readFileSync(fileName, 'utf8')) as Definition;
|
||||
} catch (e) {
|
||||
return exitWithError(e.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user