deno.land / std@0.166.0 / testing / mock_examples / random.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.export function randomInt(lowerBound: number, upperBound: number): number { return lowerBound + Math.floor(Math.random() * (upperBound - lowerBound));}
export function randomMultiple(value: number): number { return value * _internals.randomInt(-10, 10);}
export const _internals = { randomInt };
std

Version Info

Tagged at
a year ago