function defineExtension(name, extension) {
    if (extension.init) {
      extension.init(internalAPI)
    }
    extensions[name] = mergeObjects(extensionBase(), extension)
  }
defineExtension initializes the extension and adds it to the htmx registry

@see https://htmx.org/api/#defineExtension

@param {string} name the extension name
@param {Partial<HtmxExtension>} extension the extension definition