All files / src ne.ts

83.33% Statements 10/12
33.33% Branches 1/3
100% Functions 1/1
81.81% Lines 9/11

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 17 18 1922x 22x 22x   22x     22x 1x     1x 1x         22x  
import fallback from './fallback.js'
import id from './identifier.js'
import isNull from './is-null.js'
import type S from './sanitised.js'
import tsql from './template.js'
 
export const ne =
  (lhs: S | string, rhs: unknown): undefined | S => {
    Iif (typeof rhs === 'undefined') {
      return undefined
    }
    const l_ = fallback(lhs, id)
    return isNull(rhs) ?
      tsql`${l_} is not null` :
      tsql`${l_} <> ${rhs}`
  }
 
export default ne