All files / src between.ts

87.5% Statements 7/8
75% Branches 3/4
100% Functions 1/1
85.71% Lines 6/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 22x       22x 1x       22x  
import fallback from './fallback.js'
import id from './identifier.js'
import tsql from './template.js'
import type S from './sanitised.js'
 
export const between =
  <T>(l: string | S, r: undefined | null | [beginExpression: T, endExpression: T]): undefined | S =>
    typeof l === 'undefined' || r == null ?
      undefined :
      tsql`${fallback(l, id)} between ${r[0]} and ${r[1]}`
 
export default between