@vgabriel45/demo-sdk 1.1.0 → 1.2.0

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.
Files changed (2) hide show
  1. package/index.js +19 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -19,3 +19,22 @@ export function celebrate(event = "release") {
19
19
  export function greetEmoji(name = "world", emoji = "👋", options = {}) {
20
20
  return `${emoji} ${greet(name, options)}`;
21
21
  }
22
+
23
+ /** Title-case a display name for UI labels. */
24
+ export function formatName(name = "") {
25
+ return String(name ?? "")
26
+ .trim()
27
+ .split(/\s+/)
28
+ .filter(Boolean)
29
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
30
+ .join(" ");
31
+ }
32
+
33
+ /** Initials from a display name, e.g. "jane doe" -> "JD". */
34
+ export function formatInitials(name = "") {
35
+ return formatName(name)
36
+ .split(/\s+/)
37
+ .filter(Boolean)
38
+ .map((word) => word.charAt(0))
39
+ .join("");
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vgabriel45/demo-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "description": "Minimal publishable package for release pipeline sandbox testing",
6
6
  "main": "index.js",