Use Object.fromEntries(), Array#flat() and Array#flatMap() (#10853)
This commit is contained in:
1 parent
b7983971ce
commit
98abb990cc
23 files changed
+85
-83
No files matched your search
@@ -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)])
|
||||
),
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user