@vgabriel45/demo-sdk 1.3.0 → 1.4.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 +11 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -24,7 +24,8 @@ export function greetEmoji(name = "world", emoji = "👋", options = {}) {
24
24
 
25
25
  /** Greet several people at once, joined with a separator. */
26
26
  export function greetMany(names = [], { separator = " ", ...options } = {}) {
27
- return names
27
+ const list = Array.isArray(names) ? names : [names];
28
+ return list
28
29
  .filter((name) => name != null && String(name).trim() !== "")
29
30
  .map((name) => greet(name, options))
30
31
  .join(separator);
@@ -53,3 +54,12 @@ export function formatInitials(name = "") {
53
54
  .map((word) => word.charAt(0))
54
55
  .join("");
55
56
  }
57
+
58
+ /** Format display text into a URL-friendly slug. */
59
+ export function formatSlug(text = "") {
60
+ return String(text ?? "")
61
+ .trim()
62
+ .toLowerCase()
63
+ .replace(/[^a-z0-9]+/g, "-")
64
+ .replace(/^-+|-+$/g, "");
65
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vgabriel45/demo-sdk",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "private": false,
5
5
  "description": "Minimal publishable package for release pipeline sandbox testing",
6
6
  "main": "index.js",