* Unlike `pushIfUnique`, this can take `undefined` as an input, and returns a new array.
(array, toAdd, equalityComparer)
| 1224 | * Unlike `pushIfUnique`, this can take `undefined` as an input, and returns a new array. |
| 1225 | */ |
| 1226 | function appendIfUnique(array, toAdd, equalityComparer) { |
| 1227 | if (array) { |
| 1228 | pushIfUnique(array, toAdd, equalityComparer); |
| 1229 | return array; |
| 1230 | } |
| 1231 | else { |
| 1232 | return [toAdd]; |
| 1233 | } |
| 1234 | } |
| 1235 | ts.appendIfUnique = appendIfUnique; |
| 1236 | function stableSortIndices(array, indices, comparer) { |
| 1237 | // sort indices by value then position |
nothing calls this directly
no test coverage detected