22 lines
418 B
Plaintext
22 lines
418 B
Plaintext
// src/text.ts
|
|
var safeText = (text) => {
|
|
if ((text == null ? void 0 : text.length) <= 4)
|
|
return text;
|
|
return text == null ? void 0 : text.slice(0, 3);
|
|
};
|
|
var safeAriaLabel = (...texts) => {
|
|
let ariaLabel = " ";
|
|
for (const text of texts) {
|
|
if (typeof text === "string" && text.length > 0) {
|
|
ariaLabel = text;
|
|
break;
|
|
}
|
|
}
|
|
return ariaLabel;
|
|
};
|
|
|
|
export {
|
|
safeText,
|
|
safeAriaLabel
|
|
};
|