(completeHistory: HistoryEntry[], sourcesToCompareTo: any[])
| 59 | } |
| 60 | |
| 61 | function getSimilarSourcesIndex(completeHistory: HistoryEntry[], sourcesToCompareTo: any[]): number { |
| 62 | let duplicateIdx = -1; |
| 63 | |
| 64 | for (let i = 0; i < completeHistory.length; i++) { |
| 65 | const diff = _.difference(sourcesToCompareTo, getArrayWithJustTheCode(completeHistory[i].sources)); |
| 66 | if (diff.length === 0) { |
| 67 | duplicateIdx = i; |
| 68 | break; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | return duplicateIdx; |
| 73 | } |
| 74 | |
| 75 | function push(stringifiedConfig: string) { |
| 76 | const config = JSON.parse(stringifiedConfig); |
no test coverage detected