transform optional into a map

const optionals = [ "A", "B", "C.D" ];

const map = makeOptionalsMap(optionals);
const map = {
A: {}
B: {}
C: { D: {} }
};

Indexable