LCOV - code coverage report
Current view: top level - randomjs/distribution - hex.ts (source / functions) Hit Total Coverage
Test: coverage.lcov Lines: 4 11 36.4 %
Date: 2021-03-12 10:43:40 Functions: 0 1 0.0 %

          Line data    Source code
       1             : import { StringDistribution } from "../types.ts";
       2           1 : import { string } from "./string.ts";
       3             : 
       4           1 : const LOWER_HEX_POOL = "0123456789abcdef";
       5           1 : const lowerHex = string(LOWER_HEX_POOL);
       6           1 : const upperHex = string(LOWER_HEX_POOL.toUpperCase());
       7             : 
       8             : /**
       9             :  * Returns a Distribution that returns a random string comprised of numbers
      10             :  * or the characters `abcdef` (or `ABCDEF`) of length `length`.
      11             :  * @param length Length of the result string
      12             :  * @param uppercase Whether the string should use `ABCDEF` instead of `abcdef`
      13             :  */
      14           0 : export function hex(uppercase?: boolean): StringDistribution {
      15           0 :   if (uppercase) {
      16           0 :     return upperHex;
      17           0 :   } else {
      18           0 :     return lowerHex;
      19           0 :   }
      20           0 : }

Generated by: LCOV version 1.15