Function
toObjectSet
(arrayOrString, delimiter)
Source from the content-addressed store, hash-verified
| 789 | * @returns {Object} An object with keys from the array or string, values set to true. |
| 790 | */ |
| 791 | const toObjectSet = (arrayOrString, delimiter) => { |
| 792 | const obj = {}; |
| 793 | |
| 794 | const define = (arr) => { |
| 795 | arr.forEach((value) => { |
| 796 | obj[value] = true; |
| 797 | }); |
| 798 | }; |
| 799 | |
| 800 | isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); |
| 801 | |
| 802 | return obj; |
| 803 | }; |
| 804 | |
| 805 | const noop = () => {}; |
| 806 | |
Callers
nothing calls this directly
Tested by
no test coverage detected