LCOV - code coverage report
Current view: top level - src/date - date.js (source / functions) Hit Total Coverage
Test: cov_profile.lcov Lines: 12 12 100.0 %
Date: 2021-12-16 00:47:58 Functions: 1 1 100.0 %
Branches: 5 5 100.0 %

           Branch data     Line data    Source code
       1                 :          8 : const date = (seeded, { min = "1940", max = "2000", long = false } = {}) => {
       2            [ + ]:         18 :   const early = new Date(min) * 1;
       3                 :         18 :   const late = new Date(max) * 1;
       4                 :         18 :   if (early > late) {
       5            [ + ]:         20 :     throw Error(`min date must be lower than max date`);
       6                 :         18 :   }
       7            [ + ]:         26 :   const diff = late - early;
       8                 :         26 :   const date = new Date(seeded.number({ max: diff }) + early).toISOString();
       9                 :         18 :   return long ? date : date.slice(0, 10);
      10         [ +  + ]:          8 : };
      11                 :          8 : 
      12                 :          4 : export default date;

Generated by: LCOV version 1.15