mirror of
https://github.com/hsjobeki/noogle.git
synced 2024-12-20 12:22:00 +03:00
23 lines
603 B
JavaScript
23 lines
603 B
JavaScript
const builtins = require("./data/builtins.json");
|
|
const types = require("./data/builtins.types.json");
|
|
const fs = require("fs");
|
|
const info = Object.entries(builtins).map(([name, meta]) => {
|
|
const fn_type = types[name]?.fn_type || null;
|
|
const { args, arity, doc } = meta;
|
|
return {
|
|
category: "builtins",
|
|
fn_type,
|
|
name,
|
|
description: [
|
|
`takes ${arity} arguments: __\`${args.join("` `")}\`__ \n`,
|
|
`${doc}\n`,
|
|
],
|
|
};
|
|
});
|
|
fs.writeFile("./models/builtins.json", JSON.stringify(info), (err) => {
|
|
if (err) {
|
|
console.error(err);
|
|
}
|
|
// file written successfully
|
|
});
|