import type { NodeDef } from '../../NodeRegistry'; import { asEntity } from '../../values'; import { any, obj } from '../shared'; export const GetProperty: NodeDef = { type: 'GetProperty', label: 'Get property', category: 'data', description: 'Reads a property (width, color, …) of an object.', inputs: [obj('object')], outputs: [any('value')], params: [{ key: 'property', label: 'Property', kind: 'text', default: 'width' }], run: (_ctx, inputs, params) => ({ outputs: { value: asEntity(inputs.object)?.props[String(params.property ?? '')] ?? null }, }), };