qtil
advanced-security/qtil-swift 0.0.3
Search

Module ConcatDelimOrderFixed

CodeQL 2.21.1 has a bug where concat with a delimiter and an order will silently drop the delimiter.

Use this module to work around that bug.

Example:

string names(int x) {
  x = 0 and result = "foo" or
  x = 1 and result = "bar" or
  x = 2 and result = "baz"
}

// BUG: selects foobarbaz
select concat(int x, string name | name = names(x) | name order by x, ",")

// FIXED: selects foo,bar,baz
select ConcatDelimOrderFixed<Chars::comma/0, names/1>::join()

Import path

import qtil.strings.Other

Predicates

join

Perform the concatenation with the given separator and items/order.

Parameters

separatorpred
itemspred