const isNodeJs = ()=> { try {return process.versions.node} catch{return false} }
function getJsxAsArray(jsx_item, the_list) {
let the_type = jsx_item['type']
the_list.push(the_type)
let the_children = jsx_item['props'].children
if (Array.isArray(the_children)) {
the_list.push(the_children[1])
}else{
getJsxAsArray(the_children, the_list)
}
return the_list
}
// const elem_arr = ['li', 'label', 'learn javascript']
// const elem_arr = ['li', 'label', 'GROK REACT']
// const elem_arr = ['li', 'label', 'use type-czech']
Used in type-czech-phone-recipes project