From f2172766606a8b4859ca5a47bb1510af534b1a37 Mon Sep 17 00:00:00 2001 From: Darren Yong Date: Tue, 24 Oct 2023 14:35:32 -0700 Subject: [PATCH] chore: fix lint issues --- lib/dereference.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dereference.js b/lib/dereference.js index f257d838..9bd67644 100644 --- a/lib/dereference.js +++ b/lib/dereference.js @@ -84,14 +84,14 @@ function crawl(obj, path, pathFromRoot, parents, processedObjects, dereferencedC const keyPathFromRoot = Pointer.join(pathFromRoot, key); const value = obj[key]; // Ensure that there are valid refs. Refs like #components/schemas is invalid - const refSlashSplit = value?.$ref?.split("/"); - + const refSlashSplit = value?.$ref?.split('/'); + // Catches external file refs: /absolute-root/absolute-root.yaml - const refHashSplit = value?.ref?.split("#"); + const refHashSplit = value?.ref?.split('#'); // Valid refs split on `/` should have an element with '#' as the last character // #components/schemas will not return a "validRef" - const validRef = refSlashSplit?.find(ele => ele.slice(-1) === "#") + const validRef = refSlashSplit?.find(ele => ele.slice(-1) === '#'); if (refSlashSplit?.length > 1 && refHashSplit?.length > 1 && !validRef) { throw new InvalidPointerError(value.$ref, keyPath); }