Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit da02b46

Browse files
authored
Update fury to 3.0.0-beta.11 (#39)
Update fury to 3.0.0-beta.11
2 parents 5a96255 + 1e68951 commit da02b46

File tree

4 files changed

+26
-46
lines changed

4 files changed

+26
-46
lines changed

package-lock.json

Lines changed: 20 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"eslint": "^5.16.0",
3737
"eslint-config-airbnb-base": "^13.1.0",
3838
"eslint-plugin-import": "^2.17.3",
39-
"fury": "^3.0.0-beta.10",
40-
"fury-adapter-apib-parser": "^0.14.0",
39+
"fury": "^3.0.0-beta.11",
40+
"fury-adapter-apib-parser": "^0.15.0",
4141
"glob": "^7.0.5",
4242
"mkdirp": "~0.5.0",
4343
"mocha": "^5.2.0",

src/APIBlueprintImporter.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@ import {Fury} from 'fury';
22
import APIBlueprintParser from 'fury-adapter-apib-parser';
33
import APIElementImporter from './APIElementImporter.js'
44

5-
function promisify(func, thisArg) {
6-
return (...args) => new Promise((resolve, reject) => {
7-
func.bind(thisArg)(...args, (err, result) => {
8-
if (result) {
9-
resolve(result);
10-
} else {
11-
reject(err);
12-
}
13-
});
14-
});
15-
}
16-
175
@registerImporter
186
export default class APIBlueprintImporter {
197
static identifier = 'io.apiary.PawExtensions.APIBlueprintImporter';
@@ -42,12 +30,9 @@ export default class APIBlueprintImporter {
4230
async import(context, items, options) {
4331
const defaultHost = options.inputs['host'];
4432

45-
// FIXME remove promisify when https://github.com/apiaryio/api-elements.js/issues/37 is live
46-
const parse = promisify(this.fury.parse, this.fury);
47-
4833
for (const item of items) {
4934
console.log('Importing Item');
50-
const parseResult = await parse({ source: item.content, mediaType: 'text/vnd.apiblueprint' });
35+
const parseResult = await this.fury.parse({ source: item.content, mediaType: 'text/vnd.apiblueprint' });
5136

5237
if (parseResult.api) {
5338
const importer = new APIElementImporter(context, defaultHost);

src/APIElementImporter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ export default class APIElementImporter {
9494
const { request } = transaction;
9595

9696
const href = coalesceElementValue(request.href, transition.href, resource.href, '/unknown');
97-
const hrefVariables = request.attributes.get('hrefVariables') || transition.hrefVariables || resource.hrefVariables;
97+
const hrefVariables = (
98+
request.hrefVariables || transition.hrefVariables || resource.hrefVariables
99+
);
98100

99101
let toExpand = {};
100102
if (hrefVariables) {

0 commit comments

Comments
 (0)