code: function toObject(value) {
    if (!Array.isArray(value)) {
      return value;
    }
  
    const map = {};
    for (let i = 0; i < value.length; i++) {
      map[value[i]] = true;
    }
    return map;
  }
docs: convert value to object