({
take: [
{ key: "lines", type: "list", label: "Text" },
{ key: "order", type: "toggle", label: "Sort ascending", value: true },
{ key: "case", type: "toggle", label: "Case sensitive", value: true },
],
make: (data) => {
const value = (v) => (data.case ? v : v.toLowerCase())
return data.lines.sort(
(a, b) => (data.order ? 1 : -1) * (value(a) > value(b) ? 1 : -1)
)
},
})