diff --git a/javascript/json-transform/src/functions/TransformerFunctionIf.ts b/javascript/json-transform/src/functions/TransformerFunctionIf.ts index 813fd57..e624953 100644 --- a/javascript/json-transform/src/functions/TransformerFunctionIf.ts +++ b/javascript/json-transform/src/functions/TransformerFunctionIf.ts @@ -34,8 +34,8 @@ class TransformerFunctionIf extends TransformerFunction { const cje = arr[0]; if (isNullOrUndefined(cje)) { condition = false; - } else if (context.isJsonBoolean(cje)) { - condition = Boolean(cje); + } else if (typeof cje === "boolean") { + condition = cje; } else { condition = isTruthy(await context.transform(cje)); } diff --git a/javascript/json-transform/src/functions/TransformerFunctionIs.ts b/javascript/json-transform/src/functions/TransformerFunctionIs.ts index 820c967..5d4ab27 100644 --- a/javascript/json-transform/src/functions/TransformerFunctionIs.ts +++ b/javascript/json-transform/src/functions/TransformerFunctionIs.ts @@ -77,7 +77,7 @@ class TransformerFunctionIs extends TransformerFunction { let that: any = null; // if operator is not in/nin then prepare the "that" argument which is a JsonElement if (op !== "IN" && op !== "NIN") { - that = await (context.isJsonNumber(value) ? context.getBigDecimal("that") : context.getJsonElement("that")); + that = await (typeof value === "number" ? context.getBigDecimal("that") : context.getJsonElement("that")); } switch (op) { case "IN": { diff --git a/javascript/json-transform/src/functions/common/FunctionContext.ts b/javascript/json-transform/src/functions/common/FunctionContext.ts index 56b2c67..5d6e71a 100644 --- a/javascript/json-transform/src/functions/common/FunctionContext.ts +++ b/javascript/json-transform/src/functions/common/FunctionContext.ts @@ -93,14 +93,6 @@ class FunctionContext { return isNullOrUndefined(value); } - public isJsonNumber(value: any) { - return typeof value === "number"; - } - - public isJsonBoolean(value: any) { - return typeof value === "boolean"; - } - public async getUnwrapped(name: string | null, reduceBigDecimals?: boolean) { const value = await this.get(name, true); if (value instanceof JsonElementStreamer) {