MCPcopy Create free account
hub / github.com/denodrivers/postgres / findDuplicatesInArray

Function findDuplicatesInArray

query/query.ts:267–276  ·  view source on GitHub ↗
(array: string[])

Source from the content-addressed store, hash-verified

265}
266
267function findDuplicatesInArray(array: string[]): string[] {
268 return array.reduce((duplicates, item, index) => {
269 const is_duplicate = array.indexOf(item) !== index;
270 if (is_duplicate && !duplicates.includes(item)) {
271 duplicates.push(item);
272 }
273
274 return duplicates;
275 }, [] as string[]);
276}
277
278function snakecaseToCamelcase(input: string) {
279 return input.split("_").reduce((res, word, i) => {

Callers 1

insertRowMethod · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected