@ibragim-dev-org/ui-forge-library 1.3.7 → 1.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.
@@ -1334,12 +1334,12 @@ class UiAvatarDirective {
1334
1334
  this.elementRef = elementRef;
1335
1335
  this.renderer = renderer;
1336
1336
  effect(() => {
1337
- let acronym = '';
1338
- this.$acronym()
1339
- .split(' ')
1340
- .forEach((v) => {
1341
- acronym = acronym + v[0];
1342
- });
1337
+ const acronym = this.$acronym()
1338
+ .trim()
1339
+ .split(/\s+/)
1340
+ .slice(0, 2)
1341
+ .map((word) => word[0])
1342
+ .join('');
1343
1343
  this.renderer.setStyle(this.elementRef.nativeElement, 'background', stringToColorGradient(acronym[0]));
1344
1344
  this.$text.set(acronym);
1345
1345
  });