All files / src number.ts

75% Statements 6/8
0% Branches 0/1
100% Functions 1/1
71.42% Lines 5/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 1322x       22x 75x     75x     75x  
import raw from './raw.js'
import type S from './sanitised.js'
 
export const number =
  (x: number): S => {
    Iif (!Number.isFinite(x)) {
      throw new TypeError(`Expected finite number, got ${x}.`)
    }
    return raw(x.toString(10))
  }
 
export default number