ets-fe-ng-sdk 20.3.6 → 20.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3158,6 +3158,12 @@ class UtilityService {
3158
3158
  * Utility to calculate approximate size of an object
3159
3159
  */
3160
3160
  this.roughSizeOfObject = this.objectSizeService.roughSizeOfObject;
3161
+ this.formatCode = (map) => (code) => {
3162
+ const codeU = code?.toString()?.toUpperCase();
3163
+ return codeU != null
3164
+ ? (map?.[code]?.title ?? map?.[codeU]?.title ?? map?.[code]?.description ?? map?.[codeU]?.description ?? code)
3165
+ : code;
3166
+ };
3161
3167
  /**
3162
3168
  * Returns the value x if it's not null or undefined, otherwise returns y
3163
3169
  * @param x - Primary value to return if not null/undefined
@@ -4102,14 +4108,12 @@ class UtilityService {
4102
4108
  */
4103
4109
  async copyPayload(payload) {
4104
4110
  try {
4105
- if (this.environment.debug) {
4106
- const elem = document.createElement('textarea');
4107
- elem.value = JSON.stringify(payload);
4108
- document.body.appendChild(elem);
4109
- elem.select();
4110
- document.execCommand('copy');
4111
- document.body.removeChild(elem);
4112
- }
4111
+ const elem = document.createElement('textarea');
4112
+ elem.value = typeof payload == 'string' ? payload : JSON.stringify(payload);
4113
+ document.body.appendChild(elem);
4114
+ elem.select();
4115
+ document.execCommand('copy');
4116
+ document.body.removeChild(elem);
4113
4117
  }
4114
4118
  catch (e) {
4115
4119
  console.error(e);