DEV: expose decorateUsername function (#17637)

Expose `decorateUsername` function to make it usable in controllers or plugin initializers.
This commit is contained in:
Krzysztof Kotlarek 2022-07-25 16:43:54 +10:00 committed by GitHub
parent 3c60b97bd5
commit 228c14479b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,7 @@ export function resetUsernameDecorators() {
usernameDecorators = [];
}
export default registerUnbound("decorate-username-selector", (username) => {
export function decorateUsername(username) {
const decorations = [];
usernameDecorators.forEach((decorator) => {
@ -18,4 +18,8 @@ export default registerUnbound("decorate-username-selector", (username) => {
});
return decorations.length ? htmlSafe(decorations.join("")) : "";
}
export default registerUnbound("decorate-username-selector", (username) => {
return decorateUsername(username);
});