| 46 | } |
| 47 | |
| 48 | async function getProps(Runtime: Client['Runtime'], objectId: string, limit = 20) { |
| 49 | if (!objectId) return []; |
| 50 | const { result } = await Runtime.getProperties({ objectId, ownProperties: true, generatePreview: true }); |
| 51 | return (result || []).slice(0, limit).map((p: any) => { |
| 52 | const v = p.value || {}; |
| 53 | const val = Object.prototype.hasOwnProperty.call(v, 'value') ? v.value : (v.description || v.type); |
| 54 | return { name: p.name, type: v.type, value: val, objectId: v.objectId }; |
| 55 | }); |
| 56 | } |
| 57 | |
| 58 | async function collectScopes(Runtime: Client['Runtime'], frame: any, parsedScripts: any[]) { |
| 59 | const scopes: any[] = []; |