Skip to content

Commit

Permalink
removed lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SB-rohitdesai committed Jun 4, 2024
1 parent c1af82b commit 36d8a2d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/dereference.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = dereference;
* @param {$RefParser} parser
* @param {$RefParserOptions} options
*/
async function dereference(parser, options) {
async function dereference (parser, options) {
parser.$refs.propertyMap = {}; // we assign a new object prior to another dereference process
// console.log('Dereferencing $ref pointers in %s', parser.$refs._root$Ref.path);
let dereferenced = await crawl(
Expand Down Expand Up @@ -42,7 +42,7 @@ async function dereference(parser, options) {
* @param {$RefParserOptions} options
* @returns {{value: object, circular: boolean}}
*/
async function crawl(
async function crawl (
obj,
path,
pathFromRoot,
Expand Down Expand Up @@ -72,7 +72,8 @@ async function crawl(
);
result.circular = dereferenced.circular;
result.value = dereferenced.value;
} else {
}

Check failure on line 75 in lib/dereference.js

View workflow job for this annotation

GitHub Actions / Node 18 on ubuntu-latest

Trailing spaces not allowed

Check failure on line 75 in lib/dereference.js

View workflow job for this annotation

GitHub Actions / Node 20 on ubuntu-latest

Trailing spaces not allowed
else {
for (let key of Object.keys(obj)) {
let keyPath = Pointer.join(path, key);
let keyPathFromRoot = Pointer.join(pathFromRoot, key);
Expand All @@ -94,7 +95,8 @@ async function crawl(
if (obj[key] !== dereferenced.value) {
obj[key] = dereferenced.value;
}
} else {
}

Check failure on line 98 in lib/dereference.js

View workflow job for this annotation

GitHub Actions / Node 18 on ubuntu-latest

Trailing spaces not allowed

Check failure on line 98 in lib/dereference.js

View workflow job for this annotation

GitHub Actions / Node 20 on ubuntu-latest

Trailing spaces not allowed
else {
if (parents.indexOf(value) === -1) {
dereferenced = await crawl(
value,
Expand All @@ -110,7 +112,8 @@ async function crawl(
if (obj[key] !== dereferenced.value) {
obj[key] = dereferenced.value;
}
} else {
}

Check failure on line 115 in lib/dereference.js

View workflow job for this annotation

GitHub Actions / Node 18 on ubuntu-latest

Trailing spaces not allowed

Check failure on line 115 in lib/dereference.js

View workflow job for this annotation

GitHub Actions / Node 20 on ubuntu-latest

Trailing spaces not allowed
else {
circular = foundCircularReference(keyPath, $refs, options);
}
}
Expand Down Expand Up @@ -138,7 +141,7 @@ async function crawl(
* @param {$RefParserOptions} options
* @returns {{value: object, circular: boolean}}
*/
async function dereference$Ref(
async function dereference$Ref (
$ref,
path,
pathFromRoot,
Expand Down Expand Up @@ -242,7 +245,7 @@ async function dereference$Ref(
* @param {$RefParserOptions} options
* @returns {boolean} - always returns true, to indicate that a circular reference was found
*/
function foundCircularReference(keyPath, $refs, options) {
function foundCircularReference (keyPath, $refs, options) {
$refs.circular = true;
if (!options.dereference.circular) {
throw ono.reference(`Circular $ref pointer found at ${keyPath}`);
Expand Down

0 comments on commit 36d8a2d

Please sign in to comment.