Fix website (#12745)
This commit is contained in:
1 parent
c6d6b25833
commit
23f5ca2476
1 file changed
+17
-2
@@ -1,9 +1,24 @@
|
||||
import * as React from "react";
|
||||
import { groupBy } from "../../../src/cli/utils.js";
|
||||
|
||||
import { SidebarCategory } from "./components.js";
|
||||
import Option from "./options.js";
|
||||
|
||||
// Copied from `/src/cli/utils.js`
|
||||
function groupBy(array, iteratee) {
|
||||
const result = Object.create(null);
|
||||
|
||||
for (const value of array) {
|
||||
const key = iteratee(value);
|
||||
|
||||
if (Array.isArray(result[key])) {
|
||||
result[key].push(value);
|
||||
} else {
|
||||
result[key] = [value];
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export default function SidebarOptions({
|
||||
categories,
|
||||
availableOptions,
|
||||
|
||||
Reference in new issue
Block a user