forstok-ui-lib 8.7.1 → 8.7.2
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.
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +412 -412
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assets/javascripts/function.ts +14 -0
package/package.json
CHANGED
|
@@ -1269,3 +1269,17 @@ export const getFileType = (file?: File | null): string => {
|
|
|
1269
1269
|
return mimeType.includes("application/") ? "document" : "";
|
|
1270
1270
|
}
|
|
1271
1271
|
};
|
|
1272
|
+
|
|
1273
|
+
export function capitalizeWords(text: string, ignoreWords = []): string {
|
|
1274
|
+
const ignoreSet = new Set<string>(ignoreWords);
|
|
1275
|
+
|
|
1276
|
+
return text.replace(/\S+/g, (word, offset) => {
|
|
1277
|
+
const lower = word.toLowerCase();
|
|
1278
|
+
|
|
1279
|
+
if (ignoreSet.has(lower) && offset !== 0) {
|
|
1280
|
+
return lower;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
return lower.charAt(0).toUpperCase() + lower.slice(1);
|
|
1284
|
+
});
|
|
1285
|
+
}
|