All files / src not-distinct.ts

54.54% Statements 6/11
0% Branches 0/3
0% Functions 0/1
50% Lines 5/10

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 1622x 22x 22x       22x               44x  
import fallback from './fallback.js'
import id from './identifier.js'
import template from './template.js'
import type S from './sanitised.js'
 
export const notDistinct =
  (lhs: S | string, rhs: unknown): undefined | S => {
    Iif (typeof lhs === 'undefined' || typeof rhs === 'undefined') {
      return undefined
    }
    const lhs_ = fallback(lhs, id)
    return template`(not (${lhs_} <> ${rhs} or ${lhs_} is null or ${rhs} is null) or (${lhs_} is null and ${rhs} is null))`
  }
 
export default notDistinct