* Patch a `debug` property getter on top of the existing object. * * NOTE: always call this method with `ngDevMode && attachDebugObject(...)` * * @param obj Object to patch * @param debugGetter Getter returning a value to patch
(obj: T, debugGetter: (this: T) => any)
| 103 | * @param debugGetter Getter returning a value to patch |
| 104 | */ |
| 105 | function attachDebugGetter<T>(obj: T, debugGetter: (this: T) => any): void { |
| 106 | if (ngDevMode) { |
| 107 | Object.defineProperty(obj, 'debug', {get: debugGetter, enumerable: false}); |
| 108 | } else { |
| 109 | throw new Error( |
| 110 | 'This method should be guarded with `ngDevMode` so that it can be tree shaken in production!', |
| 111 | ); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Create dynamic nodes from i18n translation block. |
no outgoing calls
no test coverage detected
searching dependent graphs…