mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
show all imports in import statement
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {map_object, filter_object, pick_keys, collect_nodes_with_parents, uniq}
|
||||
import {map_object, filter_object, collect_nodes_with_parents, uniq}
|
||||
from './utils.js'
|
||||
import {
|
||||
is_eq, is_child, ancestry, ancestry_inc, map_tree,
|
||||
@@ -718,10 +718,7 @@ const get_value_explorer = (state, index) => {
|
||||
} else if(stmt.type == 'import'){
|
||||
result = {
|
||||
ok: true,
|
||||
value: pick_keys(
|
||||
state.modules[stmt.full_import_path],
|
||||
stmt.imports.map(i => i.value)
|
||||
),
|
||||
value: state.modules[stmt.full_import_path],
|
||||
}
|
||||
} else if (stmt.type == 'export') {
|
||||
result = stmt.children[0].children[1].result
|
||||
|
||||
@@ -41,12 +41,6 @@ export const map_find = (arr, mapper) => arr.reduce(
|
||||
null
|
||||
)
|
||||
|
||||
export const pick_keys = (obj, keys) => {
|
||||
return Object.fromEntries(
|
||||
Object.entries(obj).filter(([k,v]) => keys.includes(k))
|
||||
)
|
||||
}
|
||||
|
||||
export const stringify = val => JSON.stringify(val, null, 2)
|
||||
|
||||
export const zip = (x,y) => {
|
||||
|
||||
Reference in New Issue
Block a user