import * as faker from "faker" ; import { Id64 , Id64String } from "@itwin/core-bentley" ; internal export const createRandomId = ( ) : Id64String => { return Id64 . fromLocalAndBriefcaseIds ( faker . random . number ( ) , faker . random . number ( ) ) ; } ; internal export const createRandomRgbColor = ( ) => { return `rgb(
    ${ faker . random . number ( { max : 255 } ) },
    ${ faker . random . number ( { max : 255 } ) },
    ${ faker . random . number ( { max : 255 } ) }
  )` ; } ; internal export const createRandomHexColor = ( ) => { const elements = [ "0" , "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , "A" , "B" , "C" , "D" , "E" , "F" ] ; let result = "#" ; let length = 6 ; while ( length -- ) result += faker . random . arrayElement ( elements ) ; return result ; } ; export function nullable < T > ( generator ) { if ( faker . random . boolean ( ) ) return undefined ; return generator ( ) ; }