mirror of https://github.com/VERT-sh/VERT.git
feat: SOME sorting
This commit is contained in:
parent
2191c95500
commit
ea53fc7b9b
|
@ -231,12 +231,21 @@
|
||||||
c.supportedFormats.find(
|
c.supportedFormats.find(
|
||||||
(f) => f.name === file.from,
|
(f) => f.name === file.from,
|
||||||
)?.isNative
|
)?.isNative
|
||||||
? c.formatStrings((f) => f.toSupported)
|
? c.supportedFormats.filter(
|
||||||
: c.formatStrings(
|
(f) => f.toSupported,
|
||||||
|
)
|
||||||
|
: c.supportedFormats.filter(
|
||||||
(f) =>
|
(f) =>
|
||||||
f.toSupported && f.isNative,
|
f.toSupported && f.isNative,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
.sort((a, b) => {
|
||||||
|
// sort native formats first
|
||||||
|
if (a.isNative && !b.isNative) return -1;
|
||||||
|
if (!a.isNative && b.isNative) return 1;
|
||||||
|
return 0;
|
||||||
|
})
|
||||||
|
.map((f) => f.name)
|
||||||
.filter(
|
.filter(
|
||||||
(format) =>
|
(format) =>
|
||||||
format !== ".svg" && format !== ".heif",
|
format !== ".svg" && format !== ".heif",
|
||||||
|
|
Loading…
Reference in New Issue