From 0b762522ace3c418ffcc1416d036782c0dcc0b4a Mon Sep 17 00:00:00 2001 From: Traxus Date: Fri, 21 Apr 2023 20:36:31 -0400 Subject: [PATCH] Signed-off-by: Traxus --- src/lib/datocms-bypass.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/datocms-bypass.ts b/src/lib/datocms-bypass.ts index d87748f..bb0b555 100644 --- a/src/lib/datocms-bypass.ts +++ b/src/lib/datocms-bypass.ts @@ -173,7 +173,7 @@ function jsonFilePathIsValid(filePath : string) { return true; } -function jsonNodeExists(jsonData : object, node : string) { +function jsonNodeExists(jsonData : any, node : string) { //-----this condition is unneccessary... so THATS what typescript is for XD //if (typeof node === 'string' || node instanceof String) { @@ -185,7 +185,7 @@ function jsonNodeExists(jsonData : object, node : string) { return false; } -function jsonNodesExist(jsonData : object, nodes : string[]) { +function jsonNodesExist(jsonData : any, nodes : any) { //-----permit basic validation of the json we are trying to spit out by checking for existence of first order nodes let node = ''; @@ -195,7 +195,7 @@ function jsonNodesExist(jsonData : object, nodes : string[]) { for (let i = 0; i < nodes.length; i++) { node = nodes[i]; - if (typeof node === 'string' || node instanceof String) { + if (typeof node === 'string') { //-----string means that PRIMARY node must exist... no checking for children etc... if (jsonNodeExists(jsonData, node) === false) { return false;