HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/alq-cali.bikenow.co/node_modules/zod/src/v3/tests/Mocker.ts
function getRandomInt(max: number) {
  return Math.floor(Math.random() * Math.floor(max));
}

const testSymbol = Symbol("test");

export class Mocker {
  pick = (...args: any[]): any => {
    return args[getRandomInt(args.length)];
  };

  get string(): string {
    return Math.random().toString(36).substring(7);
  }
  get number(): number {
    return Math.random() * 100;
  }
  get bigint(): bigint {
    return BigInt(Math.floor(Math.random() * 10000));
  }
  get boolean(): boolean {
    return Math.random() < 0.5;
  }
  get date(): Date {
    return new Date(Math.floor(Date.now() * Math.random()));
  }
  get symbol(): symbol {
    return testSymbol;
  }
  get null(): null {
    return null;
  }
  get undefined(): undefined {
    return undefined;
  }
  get stringOptional(): string | undefined {
    return this.pick(this.string, this.undefined);
  }
  get stringNullable(): string | null {
    return this.pick(this.string, this.null);
  }
  get numberOptional(): number | undefined {
    return this.pick(this.number, this.undefined);
  }
  get numberNullable(): number | null {
    return this.pick(this.number, this.null);
  }
  get booleanOptional(): boolean | undefined {
    return this.pick(this.boolean, this.undefined);
  }
  get booleanNullable(): boolean | null {
    return this.pick(this.boolean, this.null);
  }
}