InternalFunctionUtils class
公用程式函式僅供內部使用
屬性
Millisecond |
在刻度與毫秒之間轉換的常數。 |
Unix |
將 unix 時間戳轉換成刻度的常數。 |
方法
access |
查閱物件的字串或數位索引。 |
access |
查閱 Map 或 Object 中的屬性。 |
common |
常見的 Stringify 物件。 |
convert |
將物件轉換成陣列。 如果實例是陣列,則傳回本身。 如果實例是物件,則傳回 {key, value} 組清單。 否則會傳回未定義。 |
foreach(Expression, Memory |
foreach 的評估工具,並選取函式。 |
get |
TextDecoder 協助程式函式。 |
get |
TextEncoder 協助程式函式。 |
is |
測試結果以查看邏輯比較函式中是否為 True。 |
lambda |
Lambda 評估工具。 |
parse |
將字串或未定義包裝成字串。 預設為空字串。 |
parse |
剖析 timex 運算。 |
parse |
將字串剖析為 URL 物件。 |
sort |
排序協助程式函式。 |
ticks(string) | 將字串輸入轉換為刻度數位。 |
time |
將 C# 期間和單位轉換成 js 句點和單位。 |
Validate |
foreach 的驗證程式、選取和其中函式。 |
verify |
確認時間戳字串是有效的 ISO 時間戳格式。 |
verify |
確認時間戳字串是有效的時間戳格式。 |
wrap |
從記憶體取得路徑的值。 |
屬性詳細資料
MillisecondToTickConstant
在刻度與毫秒之間轉換的常數。
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)
常見的 Stringify 物件。
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 的評估工具,並選取函式。
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 運算。
static function parseTimexProperty(timexExpr: any): { error: string, timexProperty: TimexProperty }
參數
- timexExpr
-
any
字串或 TimexProperty 輸入。
傳回
{ error: string, timexProperty: TimexProperty }
TimexProperty 和 error。
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 的驗證程式、選取和其中函式。
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
記憶體中路徑的值。