InternalFunctionUtils class
实用工具函数仅使用内部函数
属性
Millisecond |
在时钟周期和 ms 之间转换的常量。 |
Unix |
将 unix 时间戳转换为时钟周期的常量。 |
方法
属性详细信息
MillisecondToTickConstant
在时钟周期和 ms 之间转换的常量。
static MillisecondToTickConstant: BigInteger = bigInt('10000')
属性值
BigInteger
UnixMilliSecondToTicksConstant
将 unix 时间戳转换为时钟周期的常量。
static UnixMilliSecondToTicksConstant: BigInteger = bigInt('621355968000000000')
属性值
BigInteger
方法详细信息
accessIndex(any, number)
查找对象的字符串或数字索引。
static function accessIndex(instance: any, index: number): ValueWithError
参数
- instance
-
any
具有属性的实例。
- index
-
number
要查找的属性。
返回
值和错误信息(如果有)。
accessProperty(any, string)
在 Map 或 Object 中查找属性。
static function accessProperty(instance: any, property: string): ValueWithError
参数
- instance
-
any
具有属性的实例。
- property
-
string
要查找的属性。
返回
值和错误信息(如果有)。
commonStringify(unknown)
通用字符串化对象。
static function commonStringify(input: unknown): string
参数
- input
-
unknown
input 对象。
返回
string
字符串化对象。
convertToList(unknown)
将对象转换为数组。 如果实例为数组,则返回自身。 如果实例为对象,则返回 {key, value} 对列表。 否则返回未定义。
static function convertToList(instance: unknown): unknown[] | undefined
参数
- instance
-
unknown
输入实例。
返回
unknown[] | undefined
生成的列表。
foreach(Expression, MemoryInterface, Options)
foreach 和 select 函数的计算器。
static function foreach(expression: Expression, state: MemoryInterface, options: Options): ValueWithError
参数
- expression
- Expression
表达。
- state
- MemoryInterface
内存范围。
- options
- Options
选项。
返回
评估的列表。
getTextDecoder(string)
TextDecoder 帮助程序函数。
static function getTextDecoder(code: string): TextDecoder
参数
- code
-
string
编码格式。
返回
TextDecoder
文本解码器。
getTextEncoder()
TextEncoder 帮助程序函数。
static function getTextEncoder(): TextEncoder
返回
TextEncoder
文本编码器。
isLogicTrue(any)
测试结果以查看逻辑比较函数中是否为 True。
static function isLogicTrue(instance: any): boolean
参数
- instance
-
any
计算值。
返回
boolean
如果布尔值为 true 或非 null,则为 True。
lambdaEvaluator<T, U>(Expression, MemoryInterface, Options, T[], (currentItem: T, result: U, error: string) => boolean)
Lambda 计算器。
static function lambdaEvaluator<T, U>(expression: Expression, state: MemoryInterface, options: Options, list: T[], callback: (currentItem: T, result: U, error: string) => boolean)
参数
- expression
- Expression
表达。
- state
- MemoryInterface
内存状态。
- options
- Options
选项。
- list
-
T[]
项列表。
- callback
-
(currentItem: T, result: U, error: string) => boolean
回叫。 返回应中断标志。
parseStringOrUndefined(string | undefined)
将字符串或未定义包装到字符串中。 默认为空字符串。
static function parseStringOrUndefined(input: string | undefined): string
参数
- input
-
string | undefined
输入字符串
返回
string
包装的字符串。
parseTimexProperty(any)
分析 timex funcition。
static function parseTimexProperty(timexExpr: any): { error: string, timexProperty: TimexProperty }
参数
- timexExpr
-
any
字符串或 TimexProperty 输入。
返回
{ error: string, timexProperty: TimexProperty }
TimexProperty 和错误。
parseUri(string)
将字符串分析为 URL 对象。
static function parseUri(uri: string): ValueWithError
参数
- uri
-
string
输入字符串 URI。
返回
已分析的 URL 对象。
sortBy(boolean)
排序帮助程序函数。
static function sortBy(isDescending: boolean): EvaluateExpressionDelegate
参数
- isDescending
-
boolean
降序标志。
返回
已排序的数组。
ticks(string)
将字符串输入转换为刻度号。
static function ticks(timeStamp: string): ValueWithError
参数
- timeStamp
-
string
字符串时间戳输入。
返回
以刻度为单位转换的字符串。
timeUnitTransformer(number, string)
将 C# 句点和单元转换为 js 句点和单元。
static function timeUnitTransformer(duration: number, cSharpStr: string): { duration: number, tsStr: OpUnitType }
参数
- duration
-
number
C# 持续时间。
- cSharpStr
-
string
C# 单元。
返回
{ duration: number, tsStr: OpUnitType }
转换后的 timeUnit。
ValidateLambdaExpression(Expression)
foreach、select 和 where 函数的验证程序。
static function ValidateLambdaExpression(expression: Expression)
参数
- expression
- Expression
要验证的表达式。
verifyISOTimestamp(any)
验证时间戳字符串是否为有效的 ISO 时间戳格式。
static function verifyISOTimestamp(value: any): string | undefined
参数
- value
-
any
要检查的时间戳字符串。
返回
string | undefined
错误或未定义(如果无效)。
verifyTimestamp(any)
验证时间戳字符串是否为有效的时间戳格式。
static function verifyTimestamp(value: any): string | undefined
参数
- value
-
any
要检查的时间戳字符串。
返回
string | undefined
错误或未定义(如果无效)。
wrapGetValue(MemoryInterface, string, Options)
从内存中获取路径的值。
static function wrapGetValue(state: MemoryInterface, path: string, options: Options): any
参数
- state
- MemoryInterface
记忆。
- path
-
string
路径字符串。
- options
- Options
选项。
返回
any
内存中路径的值。