function _import (name, value, options) {
    // TODO: refactor this function, it's to complicated and contains duplicate code
    if (options.wrap && typeof value === 'function') {
      // create a wrapper around the function
      value = _wrap(value)
    }

    // turn a plain function with a typed-function signature into a typed-function
    if (hasTypedFunctionSignature(value)) {
      value = typed(name, {
        [value.signature]: value
      })
    }

    if (typed.isTypedFunction(math[name]) && typed.isTypedFunction(value)) {
      if (options.override) {
        // give the typed function the right name
        value = typed(name, value.signatures)
      } else {
        // merge the existing and typed function
        value = typed(math[name], value)
      }

      math[name] = value
      delete importedFactories[name]

      _importTransform(name, value)
      math.emit('import', name, function resolver () {
        return value
      })
      return
    }

    const isDefined = math[name] !== undefined
    const isValuelessUnit = math.Unit?.isValuelessUnit(name)
    if ((!isDefined && !isValuelessUnit) || options.override) {
      math[name] = value
      delete importedFactories[name]

      _importTransform(name, value)
      math.emit('import', name, function resolver () {
        return value
      })
      return
    }

    if (!options.silent) {
      throw new Error('Cannot import "' + name + '": already exists')
    }
  }
Add a property to the math namespace
@param {string} name
@param {*} value
@param {Object} options  See import for a description of the options
@private