(
condition: IIndexedHeaderElement | undefined,
headerIndex: number
)
| 108 | } |
| 109 | |
| 110 | export function ifHeaderIndex( |
| 111 | condition: IIndexedHeaderElement | undefined, |
| 112 | headerIndex: number |
| 113 | ) { |
| 114 | if (!condition || condition.header_index === undefined) { |
| 115 | return true; |
| 116 | } |
| 117 | |
| 118 | const headerCondition = condition.header_index; |
| 119 | return typeof headerCondition === 'string' |
| 120 | ? headerIndex % 2 === (headerCondition === 'odd' ? 1 : 0) |
| 121 | : Array.isArray(headerCondition) |
| 122 | ? R.includes(headerIndex, headerCondition) |
| 123 | : headerIndex === headerCondition; |
| 124 | } |
| 125 | |
| 126 | export function ifFilter( |
| 127 | condition: IConditionalElement | undefined, |
no outgoing calls
no test coverage detected
searching dependent graphs…