Expose the names of a module's defined function via modulemeta
This reuses the existing `block_list_funcs` capability and adds an extra field on the `modulemeta` output, called `defs`, containing that list of functions.
This commit is contained in:
1 parent
fdab39bc7b
commit
65ed95c93a
2 files changed
+8
-3
No files matched your search
@@ -390,6 +390,7 @@ jv load_module_meta(jq_state *jq, jv mod_relpath) {
|
||||
if (jv_get_kind(meta) == JV_KIND_NULL)
|
||||
meta = jv_object();
|
||||
meta = jv_object_set(meta, jv_string("deps"), block_take_imports(&program));
|
||||
meta = jv_object_set(meta, jv_string("defs"), block_list_funcs(program, 0));
|
||||
}
|
||||
locfile_free(src);
|
||||
block_free(program);
|
||||
|
||||
Reference in new issue
Block a user