Function
setValue
(obj: any, key: string, value: any)
Source from the content-addressed store, hash-verified
| 99 | // Helpers |
| 100 | |
| 101 | function setValue(obj: any, key: string, value: any) { |
| 102 | const lowerCaseKey = key.toLowerCase(); |
| 103 | |
| 104 | for (const key of Object.keys(obj)) { |
| 105 | if (key.toLowerCase() === lowerCaseKey) { |
| 106 | obj[key] = value; |
| 107 | return; |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | obj[key] = value; |
| 112 | } |
| 113 | |
| 114 | function getValue(obj: any, key: string): string | undefined { |
| 115 | const lowerCaseKey = key.toLowerCase(); |
Tested by
no test coverage detected