* Convert to a plain JSON object
()
| 975 | * Convert to a plain JSON object |
| 976 | */ |
| 977 | toJSON(): JSONObject { |
| 978 | const json: JSONObject = { |
| 979 | key: this.key, |
| 980 | scope: this.scope, |
| 981 | tags: this.tagMap, |
| 982 | isLocked: this.isLocked, |
| 983 | }; |
| 984 | if (this.type != null) { |
| 985 | json.type = this.type; |
| 986 | } |
| 987 | switch (this._source?.type) { |
| 988 | case BindingType.CLASS: |
| 989 | json.valueConstructor = this._source?.value.name; |
| 990 | break; |
| 991 | case BindingType.PROVIDER: |
| 992 | json.providerConstructor = this._source?.value.name; |
| 993 | break; |
| 994 | case BindingType.ALIAS: |
| 995 | json.alias = this._source?.value.toString(); |
| 996 | break; |
| 997 | } |
| 998 | return json; |
| 999 | } |
| 1000 | |
| 1001 | /** |
| 1002 | * Inspect the binding to return a json representation of the binding information |
no test coverage detected