UNPKG

godprotocol

Version:

A distributed computing environment for Web 4.0 — integrating AI, decentralisation, and virtual computation.

32 lines (27 loc) 624 B
const type_of = (args, {vm})=>{ let {object} = args; return object.type } const instance_of = async(args, {vm})=>{ let {object} = args; let result; if (vm.datatypes.includes(object.type)){ result = { type: 'address', value: object.type, _id: object.type, config: true } }else if(['class', 'function'].includes(object.type)){ result = await vm.voided() }else if (object.type === 'instance'){ result = { type: 'function', address: object.config.cls, _id: object.config.cls_id, } } return result; } export default type_of export {instance_of}