makeGetTitle = (fnAccessor) => {
  const getTitle = (schema, { lookup = "extended" } = {}) => {
    const fn = fnAccessor()

    if (schema?.title != null) return fn.upperFirst(String(schema.title))
    if (lookup === "extended") {
      if (schema?.$anchor != null) return fn.upperFirst(String(schema.$anchor))
      if (schema?.$id != null) return String(schema.$id)
    }

    return ""
  }

  return getTitle
}
Lookup can be `basic` or `extended`. By default the lookup is `extended`.