(obj: any)
| 76 | } |
| 77 | |
| 78 | export function hidePrivateProperties(obj: any) { |
| 79 | for (const key in obj) { |
| 80 | if (key.startsWith('_') && obj.hasOwnProperty(key)) { |
| 81 | Object.defineProperty(obj, key, { |
| 82 | enumerable: false, |
| 83 | configurable: true, // Allows redefinition if necessary |
| 84 | writable: true, // Allows modification |
| 85 | value: obj[key], |
| 86 | }); |
| 87 | } |
| 88 | } |
| 89 | } |