import type { NodeDef } from '../../NodeRegistry'; import { asEntity } from '../../values'; import { assetParam, bool, obj } from '../shared'; export const IsAsset: NodeDef = { type: 'IsAsset', label: 'Is asset', category: 'data', description: 'Whether an object is an instance of the chosen asset – the way to tell what you collided with.', inputs: [obj('object')], outputs: [bool('result')], params: [assetParam], run: (_ctx, inputs, params) => { const assetId = String(params.asset ?? ''); return { outputs: { result: Boolean(assetId) && asEntity(inputs.object)?.assetId === assetId } }; }, };