Maybe生成器
Maybe生成器 · helpers.maybe. 生成方法 · 示例
helpers.maybe
生成设置
生成后在这里查看结果。
参数 & 示例
Returns the result of the callback if the probability check was successful, otherwise undefined.
helpers.maybe(callback: () => TResult, options?: { probability? })- callback
- The callback that will be invoked if the probability check was successful.
- options
- The options to use.
- options.probability
- The probability ([0.00, 1.00]) of the callback being invoked. Defaults to 0.5.
示例
null请在测试环境使用合成数据。