All files / src not-in.ts

90% Statements 9/10
71.42% Branches 5/7
100% Functions 1/1
88.88% Lines 8/9

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 13 14 15 16 1722x 22x 22x 22x 22x       22x 1x           44x  
import fallback from './fallback.js'
import id from './identifier.js'
import isNull from './is-null.js'
import row from './row.js'
import tsql from './template.js'
import type S from './sanitised.js'
 
export const notIn =
  (l: S | string, r: undefined | null | unknown[]): undefined | S =>
    typeof r === 'undefined' ?
      undefined :
      r && !isNull(r) && (r.length > 0) ?
        tsql`${fallback(l, id)} not in ${row(r)}` :
        tsql`${fallback(l, id)} is not null`
 
export default notIn