code: function defaultAttrs(attrs) {
    let defaults = Object.create(null)
    for (let attrName in attrs) {
      let attr = attrs[attrName]
      if (!attr.hasDefault) return null
      defaults[attrName] = attr.default
    }
    return defaults
  }
docs: For node types where all attrs have a default value (or which don't have any attributes), build up a single reusable default attribute object, and use it for all nodes that don't specify specific attributes.