(list, caseInsensitive)
| 1 | const { hasOwnProperty } = Object.prototype; |
| 2 | |
| 3 | function buildMap(list, caseInsensitive) { |
| 4 | const map = Object.create(null); |
| 5 | |
| 6 | if (!Array.isArray(list)) { |
| 7 | return null; |
| 8 | } |
| 9 | |
| 10 | for (let name of list) { |
| 11 | if (caseInsensitive) { |
| 12 | name = name.toLowerCase(); |
| 13 | } |
| 14 | |
| 15 | map[name] = true; |
| 16 | } |
| 17 | |
| 18 | return map; |
| 19 | } |
| 20 | |
| 21 | function buildList(data) { |
| 22 | if (!data) { |
no outgoing calls
no test coverage detected
searching dependent graphs…