Skip to content

Commit b80bef7

Browse files
committed
Fix lint warnings
1 parent e856ca0 commit b80bef7

File tree

3 files changed

+56
-54
lines changed

3 files changed

+56
-54
lines changed

lib/dereference.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ function crawl (obj, path, pathFromRoot, parents, processedObjects, dereferenced
5858
let keyPath = Pointer.join(path, key);
5959
let keyPathFromRoot = Pointer.join(pathFromRoot, key);
6060

61-
if (isExcludedPath(keyPathFromRoot)) continue;
61+
if (isExcludedPath(keyPathFromRoot)) {
62+
continue;
63+
}
6264

6365
let value = obj[key];
6466
let circular = false;

test/specs/ref-in-excluded-path/dereferenced.js

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

33
module.exports = {
4-
"components": {
5-
"examples": {
4+
components: {
5+
examples: {
66
"confirmation-failure": {
7-
"value": {
8-
"$ref": "#/literal-component-example"
7+
value: {
8+
$ref: "#/literal-component-example"
99
}
1010
},
1111
"confirmation-success": {
12-
"value": {
13-
"abc": "def"
12+
value: {
13+
abc: "def"
1414
}
1515
},
1616
"query-example": {
17-
"value": "abc"
17+
value: "abc"
1818
}
1919
},
20-
"parameters": {
21-
"a": {
22-
"example": {
23-
"$ref": "#/literal-param-component-example"
20+
parameters: {
21+
a: {
22+
example: {
23+
$ref: "#/literal-param-component-example"
2424
}
2525
},
26-
"b": {
27-
"examples": {
28-
"example1": {
29-
"value": {
30-
"$ref": "#/literal-param-component-examples1"
26+
b: {
27+
examples: {
28+
example1: {
29+
value: {
30+
$ref: "#/literal-param-component-examples1"
3131
}
3232
}
3333
}
3434
}
3535
}
3636
},
37-
"paths": {
37+
paths: {
3838
"/x/{id}": {
39-
"parameters": [
39+
parameters: [
4040
{
41-
"example": 123,
42-
"in": "path",
43-
"name": "id"
41+
example: 123,
42+
in: "path",
43+
name: "id"
4444
},
4545
{
46-
"examples": {
47-
"e1": {
48-
"value": {
49-
"$ref": "#/literal-h1"
46+
examples: {
47+
e1: {
48+
value: {
49+
$ref: "#/literal-h1"
5050
}
5151
}
5252
},
53-
"in": "header",
54-
"name": "h1"
53+
in: "header",
54+
name: "h1"
5555
},
5656
{
57-
"example": {
58-
"$ref": "#/literal-q1"
57+
example: {
58+
$ref: "#/literal-q1"
5959
},
60-
"in": "query",
61-
"name": "q1"
60+
in: "query",
61+
name: "q1"
6262
},
6363
{
64-
"examples": {
65-
"q2": {
66-
"value": "abc"
64+
examples: {
65+
q2: {
66+
value: "abc"
6767
}
6868
},
69-
"in": "query",
70-
"name": "q2"
69+
in: "query",
70+
name: "q2"
7171
}
7272
],
73-
"responses": {
74-
"200": {
75-
"content": {
73+
responses: {
74+
200: {
75+
content: {
7676
"application/json": {
77-
"examples": {
77+
examples: {
7878
"confirmation-failure": {
79-
"value": {
80-
"$ref": "#/literal-component-example"
79+
value: {
80+
$ref: "#/literal-component-example"
8181
}
8282
},
8383
"confirmation-in-progress": {
84-
"summary": "In progress response",
85-
"value": {
86-
"$ref": "#/abc"
84+
summary: "In progress response",
85+
value: {
86+
$ref: "#/abc"
8787
}
8888
},
8989
"confirmation-success": {
90-
"value": {
91-
"abc": "def"
90+
value: {
91+
abc: "def"
9292
}
9393
}
9494
}
9595
}
9696
}
9797
},
98-
"400": {
99-
"content": {
98+
400: {
99+
content: {
100100
"application/json": {
101-
"example": {
102-
"$ref": "#/literal-example"
101+
example: {
102+
$ref: "#/literal-example"
103103
}
104104
}
105105
}

test/specs/ref-in-excluded-path/ref-in-excluded-path.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe("Schema with literal $refs in examples", () => {
1010
let parser = new $RefParser();
1111
const schema = await parser.dereference(path.rel("specs/ref-in-excluded-path/ref-in-excluded-path.yaml"), {
1212
dereference: {
13-
excludedPathMatcher: (path) => {
14-
return /\/example(\/|$|s\/[^\/]+\/value(\/|$))/.test(path);
13+
excludedPathMatcher: (schemaPath) => {
14+
return /\/example(\/|$|s\/[^\/]+\/value(\/|$))/.test(schemaPath);
1515
}
1616
}
1717
});

0 commit comments

Comments
 (0)