Skip to content

Commit

Permalink
align with java-0.2.5 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
elisherer committed Aug 22, 2024
1 parent 374822f commit e3f2fbc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e3f2fbc

Please sign in to comment.