次の方法で共有


Extensions class

一部のユーティリティ関数と拡張関数

メソッド

isMemoryInterface(any)

修正方法 TODO: より良い解決策はありますか? オブジェクトが MemoryInterface を実装しているかどうかを判断します。 C の 'is MemoryInterface' と同じです#

randomNext(MemoryInterface, number, number)

ジェネレーターのランダム シードとプロパティからの値。 値が null でない場合、モックランダム値の結果は min + (値 % (max - min)) になります。

メソッドの詳細

isMemoryInterface(any)

修正方法 TODO: より良い解決策はありますか? オブジェクトが MemoryInterface を実装しているかどうかを判断します。 C の 'is MemoryInterface' と同じです#

static function isMemoryInterface(obj: any): boolean

パラメーター

obj

any

評価するオブジェクト。

戻り値

boolean

オブジェクトが MemoryInterface を実装する場合は True。そうでない場合は False。

randomNext(MemoryInterface, number, number)

ジェネレーターのランダム シードとプロパティからの値。 値が null でない場合、モックランダム値の結果は min + (値 % (max - min)) になります。

static function randomNext(memory: MemoryInterface, min: number, max: number): number

パラメーター

memory
MemoryInterface

メモリの状態。

min

number

返される乱数の包括下限。

max

number

返される乱数の排他的上限。 max は min 以上である必要があります。

戻り値

number

ランダムな値。