mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Removed necessity for Array.flat and Array.flatMap polyfill
This commit is contained in:
parent
54bef7bfe5
commit
b37c668a9a
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -23,5 +23,5 @@
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
<script src="{{ 'assets/javascripts/custom.a2f5d53d.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/custom.785bde5b.min.js' | url }}"></script>
|
||||
{% endblock %}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -222,7 +222,7 @@
|
||||
"base": base_url,
|
||||
"features": features,
|
||||
"translations": {},
|
||||
"search": "assets/javascripts/workers/search.780af0f4.min.js" | url
|
||||
"search": "assets/javascripts/workers/search.dfff1995.min.js" | url
|
||||
} -%}
|
||||
{%- if config.extra.version -%}
|
||||
{%- set _ = app.update({ "version": config.extra.version }) -%}
|
||||
@ -250,7 +250,7 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/bundle.c1c13a0d.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.4e31edb1.min.js' | url }}"></script>
|
||||
{% for path in config.extra_javascript %}
|
||||
{% if path.endswith(".mjs") %}
|
||||
<script type="module" src="{{ path | url }}"></script>
|
||||
|
@ -80,7 +80,7 @@ export type Translations =
|
||||
*/
|
||||
export interface Versioning {
|
||||
provider: "mike" /* Version provider */
|
||||
default?: string /* Default version */
|
||||
default?: string | string[] /* Default version */
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -89,7 +89,10 @@ export function transform(
|
||||
|
||||
/* => 4 */
|
||||
.split(/\s+/g)
|
||||
.flatMap(fn)
|
||||
.reduce((prev, term) => {
|
||||
const next = fn(term)
|
||||
return [...prev, ...Array.isArray(next) ? next : [next]]
|
||||
}, [] as string[])
|
||||
.map(term => /([~^]$)/.test(term) ? `${term}1` : term)
|
||||
.map(term => /(^[+-]|[~^]\d+$)/.test(term) ? term : `${term}*`)
|
||||
.join(" ")
|
||||
|
@ -161,8 +161,12 @@ export function setupVersionSelector(
|
||||
if (outdated === null) {
|
||||
outdated = true
|
||||
|
||||
/* Obtain and normalize default versions */
|
||||
let ignored = config.version?.default || "latest"
|
||||
if (!Array.isArray(ignored))
|
||||
ignored = [ignored]
|
||||
|
||||
/* Check if version is considered a default */
|
||||
const ignored = [config.version?.default || ["latest"]].flat()
|
||||
main: for (const ignore of ignored)
|
||||
for (const alias of current.aliases)
|
||||
if (new RegExp(ignore, "i").test(alias)) {
|
||||
|
Loading…
Reference in New Issue
Block a user