@umbraco-ui/uui-avatar
Advanced tools
Comparing version
@@ -42,9 +42,13 @@ import { defineElement } from '@umbraco-ui/uui-base/lib/registration'; | ||
let initials = ""; | ||
if (name) { | ||
const words = name.match(/(\w+)/g) || []; | ||
initials = words[0].substring(0, 1); | ||
if (words.length > 1) { | ||
initials += words[words.length - 1].substring(0, 1); | ||
} | ||
if (!name) { | ||
return initials; | ||
} | ||
const words = name.match(/(\w+)/g); | ||
if (!(words == null ? void 0 : words.length)) { | ||
return initials; | ||
} | ||
initials = words[0].substring(0, 1); | ||
if (words.length > 1) { | ||
initials += words[words.length - 1].substring(0, 1); | ||
} | ||
return initials.toUpperCase(); | ||
@@ -51,0 +55,0 @@ } |
{ | ||
"name": "@umbraco-ui/uui-avatar", | ||
"version": "1.1.0", | ||
"version": "1.2.0-rc.0", | ||
"license": "MIT", | ||
@@ -33,3 +33,3 @@ "description": "An avatar web component for displaying user avatars.", | ||
"dependencies": { | ||
"@umbraco-ui/uui-base": "1.1.0" | ||
"@umbraco-ui/uui-base": "1.2.0-rc.0" | ||
}, | ||
@@ -45,3 +45,3 @@ "scripts": { | ||
"homepage": "https://uui.umbraco.com/?path=/story/uui-avatar", | ||
"gitHead": "5159a81e353c893c30073cdbf2fdd94306477d6e" | ||
"gitHead": "43f1b9a8bd1721af30ba7c145517ee665d874df3" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10056
0.99%245
1.66%1
Infinity%+ Added
- Removed