* Clean up an array to harden against CSPP * * @param array - The array to be cleaned. * @returns The cleaned version of the array
(array: T[])
| 151 | * @returns The cleaned version of the array |
| 152 | */ |
| 153 | function cleanArray<T>(array: T[]): Array<T | null> { |
| 154 | for (let index = 0; index < array.length; index++) { |
| 155 | const isPropertyExist = objectHasOwnProperty(array, index); |
| 156 | |
| 157 | if (!isPropertyExist) { |
| 158 | array[index] = null; |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | return array; |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * Shallow clone an object |
no outgoing calls
no test coverage detected
searching dependent graphs…