MCPcopy Index your code
hub / github.com/nodejs/node / appendIfUnique

Function appendIfUnique

test/fixtures/snapshot/typescript.js:1226–1234  ·  view source on GitHub ↗

* Unlike `pushIfUnique`, this can take `undefined` as an input, and returns a new array.

(array, toAdd, equalityComparer)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

pushIfUniqueFunction · 0.85

Tested by

no test coverage detected