All files / src limited-hints-identifier.ts

100% Statements 8/8
100% Branches 4/4
100% Functions 1/1
100% Lines 7/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 13 14 1522x 22x 22x 22x         22x 20x       22x  
import * as TableHintLimited from './table-hint-limited.js'
import identifier from './identifier.js'
import list from './list.js'
import template from './template.js'
import type S from './sanitised.js'
 
/** @returns identifier with optional, [limited hints](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table). */
const limitedHintsIdentifier =
  (table: Parameters<typeof identifier>[0], hints?: TableHintLimited.t[]): S =>
    hints && hints.length > 0 ?
      template`${identifier(table)} with (${list(hints, TableHintLimited.sanitized)})` :
      identifier(table)
 
export default limitedHintsIdentifier