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 19 20 21 22 23 24 25 | 22x 22x 22x 22x 22x 22x 22x 11x 32x | import id from './identifier.js'
import tsql from './template.js'
import fallback from './fallback.js'
import isNull from './is-null.js'
import row from './row.js'
import type S from './sanitised.js'
import logicalFalse from './logical-false.js'
/**
* @returns LHS in (RHS) expression.
*
* `undefined` RHS propagates.
*
* Falsy or empty array RHS returns logical false.
*/
export const in_ =
(l: S | string, r: undefined | null | unknown[]): undefined | S =>
typeof r === 'undefined' ?
undefined :
r && !isNull(r) && (r.length > 0) ?
tsql`${fallback(l, id)} in ${row(r)}` :
logicalFalse
export default in_
|