Use Object.fromEntries(), Array#flat() and Array#flatMap() (#10853)

This commit is contained in:
fisker Cheung authored and GitHub committed 2021-05-12 01:05:29 +08:00
1 parent b7983971ce
commit 98abb990cc
23 files changed
+85 -83

No files matched your search

+1 -2
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env node
"use strict";
const fromPairs = require("lodash/fromPairs");
if (require.main !== module) {
module.exports = generateSchema;
@@ -22,7 +21,7 @@ function generateSchema(options) {
definitions: {
optionsDefinition: {
type: "object",
properties: fromPairs(
properties: Object.fromEntries(
options.map((option) => [option.name, optionToSchema(option)])
),
},