code: function(el, name) {
    var readAll = arguments.length === 1;
    var domNames, domName, jsNames, jsName, value, idx, length;
  
    if (readAll) {
      domNames = Object.keys(el.attribs).filter(function(attrName) {
        return attrName.slice(0, dataAttrPrefix.length) === dataAttrPrefix;
      });
      jsNames = domNames.map(function(_domName) {
        return camelCase(_domName.slice(dataAttrPrefix.length));
      });
    } else {
      domNames = [dataAttrPrefix + cssCase(name)];
      jsNames = [name];
    }
  
    for (idx = 0, length = domNames.length; idx < length; ++idx) {
      domName = domNames[idx];
      jsName = jsNames[idx];
      if (hasOwn.call(el.attribs, domName)) {
        value = el.attribs[domName];
  
        if (hasOwn.call(primitives, value)) {
          value = primitives[value];
        } else if (value === String(Number(value))) {
          value = Number(value);
        } else if (rbrace.test(value)) {
          try {
            value = JSON.parse(value);
          } catch(e){ }
        }
  
        el.data[jsName] = value;
      }
    }
  
    return readAll ? el.data : value;
  }
docs: Read the specified attribute from the equivalent HTML5 `data-*` attribute, and (if present) cache the value in the node's internal data store. If no attribute name is specified, read *all* HTML5 `data-*` attributes in this manner.