Skip to content

Commit

Permalink
Merge branch 'main' into southworks/update/p-map
Browse files Browse the repository at this point in the history
  • Loading branch information
JhontSouth committed Jan 6, 2025
2 parents f4487ec + 4c055b7 commit f3dddee
Show file tree
Hide file tree
Showing 546 changed files with 3,786 additions and 4,050 deletions.
11 changes: 0 additions & 11 deletions libraries/adaptive-expressions-ie11/eslint.config.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion libraries/adaptive-expressions-ie11/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"build": "npm-run-all clean build:browser",
"build:browser": "tsup --config ../../tsup/browser.config.ts --define.outfile dist/index.js --dts",
"clean": "rimraf dist",
"lint": "eslint ."
"lint": "eslint . --config ../../eslint.config.cjs"
},
"files": [
"dist"
Expand Down
11 changes: 3 additions & 8 deletions libraries/adaptive-expressions/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
const onlyWarn = require("eslint-plugin-only-warn");
const sharedConfig = require("../../eslint.config.cjs")
const sharedConfig = require('../../eslint.config.cjs');

module.exports = [
...sharedConfig,
{
ignores: ["**/generated/*", "**/expressionProperty.test.js"],
ignores: ['**/generated/*', '**/expressionProperty.test.js'],
},
{
plugins: {
"only-warn": onlyWarn,
},
}];
];
1 change: 0 additions & 1 deletion libraries/adaptive-expressions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"btoa-lite": "^1.0.0",
"d3-format": "^2.0.0",
"dayjs": "^1.11.13",
"eslint-plugin-only-warn": "^1.1.0",
"jspath": "^0.4.0",
"lodash": "^4.17.21",
"lru-cache": "^5.1.1",
Expand Down
2 changes: 1 addition & 1 deletion libraries/adaptive-expressions/src/builtinFunctions/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class Add extends ExpressionEvaluator {
expression,
2,
Number.MAX_SAFE_INTEGER,
ReturnType.String | ReturnType.Number
ReturnType.String | ReturnType.Number,
);
}
}
13 changes: 5 additions & 8 deletions libraries/adaptive-expressions/src/builtinFunctions/addDays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ export class AddDays extends TimeTransformEvaluator {
* Initializes a new instance of the [AddDays](xref:adaptive-expressions.AddDays) class.
*/
constructor() {
super(
ExpressionType.AddDays,
(ts: Date, num: number): Date => {
const newDate = new Date(ts);
newDate.setDate(ts.getDate() + num);
return newDate;
}
);
super(ExpressionType.AddDays, (ts: Date, num: number): Date => {
const newDate = new Date(ts);
newDate.setDate(ts.getDate() + num);
return newDate;
});
}
}
13 changes: 5 additions & 8 deletions libraries/adaptive-expressions/src/builtinFunctions/addHours.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ export class AddHours extends TimeTransformEvaluator {
* Initializes a new instance of the [AddHours](xref:adaptive-expressions.AddHours) class.
*/
constructor() {
super(
ExpressionType.AddHours,
(ts: Date, num: number): Date => {
const newDate = new Date(ts);
newDate.setHours(ts.getHours() + num);
return newDate;
}
);
super(ExpressionType.AddHours, (ts: Date, num: number): Date => {
const newDate = new Date(ts);
newDate.setHours(ts.getHours() + num);
return newDate;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ export class AddMinutes extends TimeTransformEvaluator {
* Initializes a new instance of the [AddMinutes](xref:adaptive-expressions.AddMinutes) class.
*/
constructor() {
super(
ExpressionType.AddMinutes,
(ts: Date, num: number): Date => {
const newDate = new Date(ts);
newDate.setMinutes(ts.getMinutes() + num);
return newDate;
}
);
super(ExpressionType.AddMinutes, (ts: Date, num: number): Date => {
const newDate = new Date(ts);
newDate.setMinutes(ts.getMinutes() + num);
return newDate;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class AddOrdinal extends ExpressionEvaluator {
private static evaluator(): EvaluateExpressionDelegate {
return FunctionUtils.apply(
(args: any[]): string => AddOrdinal.evalAddOrdinal(args[0]),
FunctionUtils.verifyInteger
FunctionUtils.verifyInteger,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ export class AddSeconds extends TimeTransformEvaluator {
* Initializes a new instance of the [AddSeconds](xref:adaptive-expressions.AddSeconds) class.
*/
constructor() {
super(
ExpressionType.AddSeconds,
(ts: Date, num: number): Date => {
const newDate = new Date(ts);
newDate.setSeconds(ts.getSeconds() + num);
return newDate;
}
);
super(ExpressionType.AddSeconds, (ts: Date, num: number): Date => {
const newDate = new Date(ts);
newDate.setSeconds(ts.getSeconds() + num);
return newDate;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class AddToTime extends ExpressionEvaluator {
interval: number,
timeUnit: string,
format?: string,
locale?: string
locale?: string,
): ValueWithError {
let result: string;
const error = InternalFunctionUtils.verifyISOTimestamp(timeStamp);
Expand All @@ -81,7 +81,7 @@ export class AddToTime extends ExpressionEvaluator {
[ReturnType.String, ReturnType.String],
ReturnType.String,
ReturnType.Number,
ReturnType.String
ReturnType.String,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Average extends ExpressionEvaluator {
private static evaluator(): EvaluateExpressionDelegate {
return FunctionUtils.apply(
(args: any[]): number => args[0].reduce((x: number, y: number): number => x + y) / args[0].length,
FunctionUtils.verifyNumericList
FunctionUtils.verifyNumericList,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class Base64ToBinary extends ExpressionEvaluator {
ExpressionType.Base64ToBinary,
Base64ToBinary.evaluator(),
ReturnType.Object,
FunctionUtils.validateUnary
FunctionUtils.validateUnary,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class Base64ToString extends ExpressionEvaluator {
ExpressionType.Base64ToString,
Base64ToString.evaluator(),
ReturnType.String,
FunctionUtils.validateUnary
FunctionUtils.validateUnary,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class Binary extends ExpressionEvaluator {
private static evaluator(): EvaluateExpressionDelegate {
return FunctionUtils.apply(
(args: any[]): Uint8Array => InternalFunctionUtils.getTextEncoder().encode(args[0]),
FunctionUtils.verifyString
FunctionUtils.verifyString,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class ComparisonEvaluator extends ExpressionEvaluator {
type: string,
func: (arg0: any[]) => boolean,
validator: ValidateExpressionDelegate,
verify?: VerifyExpression
verify?: VerifyExpression,
) {
super(type, ComparisonEvaluator.evaluator(func, verify), ReturnType.Boolean, validator);
}
Expand All @@ -52,7 +52,7 @@ export class ComparisonEvaluator extends ExpressionEvaluator {
expression,
state,
newOptions,
verify
verify,
);
let error = childrenError;
if (!error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class Concat extends ExpressionEvaluator {
ExpressionType.Concat,
Concat.evaluator(),
ReturnType.String | ReturnType.Array,
FunctionUtils.validateAtLeastOne
FunctionUtils.validateAtLeastOne,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class ConvertFromUTC extends ExpressionEvaluator {
timeStamp: string,
destinationTimeZone: string,
format?: string,
locale?: string
locale?: string,
): ValueWithError {
let result: string;
let error: string;
Expand Down Expand Up @@ -89,7 +89,7 @@ export class ConvertFromUTC extends ExpressionEvaluator {
expression,
[ReturnType.String, ReturnType.String],
ReturnType.String,
ReturnType.String
ReturnType.String,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class ConvertToUTC extends ExpressionEvaluator {
timeStamp: string,
sourceTimezone: string,
format?: string,
locale?: string
locale?: string,
): ValueWithError {
let result: string;
let error: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class CountWord extends ExpressionEvaluator {
private static evaluator(): EvaluateExpressionDelegate {
return FunctionUtils.apply(
(args: any[]): number => InternalFunctionUtils.parseStringOrUndefined(args[0]).trim().split(/\s+/).length,
FunctionUtils.verifyStringOrNull
FunctionUtils.verifyStringOrNull,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class DataUri extends ExpressionEvaluator {
private static evaluator(): EvaluateExpressionDelegate {
return FunctionUtils.apply(
(args: any[]): string => 'data:text/plain;charset=utf-8;base64,'.concat(btoa(args[0])),
FunctionUtils.verifyString
FunctionUtils.verifyString,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class DataUriToBinary extends ExpressionEvaluator {
ExpressionType.DataUriToBinary,
DataUriToBinary.evaluator(),
ReturnType.Object,
FunctionUtils.validateUnary
FunctionUtils.validateUnary,
);
}

Expand All @@ -34,7 +34,7 @@ export class DataUriToBinary extends ExpressionEvaluator {
private static evaluator(): EvaluateExpressionDelegate {
return FunctionUtils.apply(
(args: any[]): Uint8Array => InternalFunctionUtils.getTextEncoder().encode(args[0]),
FunctionUtils.verifyString
FunctionUtils.verifyString,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class DataUriToString extends ExpressionEvaluator {
ExpressionType.DataUriToString,
DataUriToString.evaluator(),
ReturnType.String,
FunctionUtils.validateUnary
FunctionUtils.validateUnary,
);
}

Expand All @@ -34,7 +34,7 @@ export class DataUriToString extends ExpressionEvaluator {
private static evaluator(): EvaluateExpressionDelegate {
return FunctionUtils.apply(
(args: any[]): string => atob(args[0].slice(args[0].indexOf(',') + 1)),
FunctionUtils.verifyString
FunctionUtils.verifyString,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export class EndsWith extends ExpressionEvaluator {
return FunctionUtils.apply(
(args: any[]): boolean =>
InternalFunctionUtils.parseStringOrUndefined(args[0]).endsWith(
InternalFunctionUtils.parseStringOrUndefined(args[1])
InternalFunctionUtils.parseStringOrUndefined(args[1]),
),
FunctionUtils.verifyStringOrNull
FunctionUtils.verifyStringOrNull,
);
}

Expand Down
3 changes: 1 addition & 2 deletions libraries/adaptive-expressions/src/builtinFunctions/eol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { EvaluateExpressionDelegate, ExpressionEvaluator } from '../expressionEv
import { ExpressionType } from '../expressionType';
import { FunctionUtils } from '../functionUtils';
import { ReturnType } from '../returnType';
import os from 'os';

/**
* Return the newline string according to the environment.
Expand Down Expand Up @@ -39,8 +40,6 @@ export class EOL extends ExpressionEvaluator {
} else if (typeof self !== 'undefined') {
return self.navigator.platform.includes('Win') ? '\r\n' : '\n';
} else {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const os = require('os');
return os.EOL;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class Equal extends ComparisonEvaluator {
super(
ExpressionType.Equal,
(args) => FunctionUtils.commonEquals(args[0], args[1]),
FunctionUtils.validateBinary
FunctionUtils.validateBinary,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Foreach extends ExpressionEvaluator {
ExpressionType.Foreach,
InternalFunctionUtils.foreach,
ReturnType.Array,
InternalFunctionUtils.ValidateLambdaExpression
InternalFunctionUtils.ValidateLambdaExpression,
);
}
}
Loading

0 comments on commit f3dddee

Please sign in to comment.