Skip to content

Commit

Permalink
Merge pull request #18 from funbox/remove-inflight
Browse files Browse the repository at this point in the history
Replace yaml formatter
  • Loading branch information
Ge11ert committed Jun 29, 2023
2 parents be9a66d + e5c4f6c commit e564ccf
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 32 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 6.0.2 (29.06.2023)

Replaced the package that prints the result as YAML.


## 6.0.1 (27.06.2023)

Fixed a vulnerability caused by a dependency of the "commander" package.
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.ru.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# История изменений проекта

## 6.0.2 (29.06.2023)

Заменили пакет, который выводит результат в виде YAML.


## 6.0.1 (27.06.2023)

Исправлена уязвимость, содержащаяся в зависимостях пакета commander.
Expand Down
98 changes: 70 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@funboxteam/crafter",
"version": "6.0.1",
"version": "6.0.2",
"description": "JavaScript replacement of Drafter library for parsing API Blueprint documentation format",
"repository": {
"type": "git",
Expand Down Expand Up @@ -41,7 +41,7 @@
"commander": "10.0.1",
"commonmark": "0.30.0",
"fast-deep-equal": "2.0.1",
"yamljs": "0.3.0"
"js-yaml": "4.1.0"
},
"jest": {
"testEnvironment": "node",
Expand Down
4 changes: 2 additions & 2 deletions parseApibFile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const yaml = require('yamljs');
const yaml = require('js-yaml');
const Crafter = require('./Crafter');

module.exports = async function parseApibFile(fileName, outputFormat, sourceMapsEnabled, debugMode, languageServerMode, contextOptions = {}) {
const result = (await Crafter.parseFile(fileName, { sourceMapsEnabled, debugMode, languageServerMode, ...contextOptions }))[0];
if (outputFormat === 'json') {
return JSON.stringify(result.toRefract(sourceMapsEnabled), null, 2);
}
return yaml.stringify(result.toRefract(sourceMapsEnabled), Infinity, 2);
return yaml.dump(result.toRefract(sourceMapsEnabled), { indent: 2 });
};

0 comments on commit e564ccf

Please sign in to comment.