@bigbinary/neeto-commons-frontend 2.1.34 → 2.1.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-commons-frontend",
3
- "version": "2.1.34",
3
+ "version": "2.1.35",
4
4
  "description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
5
5
  "repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",
package/utils.cjs.js CHANGED
@@ -2638,6 +2638,14 @@ var joinHyphenCase = function joinHyphenCase() {
2638
2638
  }
2639
2639
  return args.join(" ").replace(/\s+/g, "-").toLowerCase();
2640
2640
  };
2641
+ var hyphenize = function hyphenize(value) {
2642
+ var fallbackString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
2643
+ if (typeof value === "number") return String(value);
2644
+ if (value && typeof value === "string" && value.replace) {
2645
+ return value.replace(/[\s_]/g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/-+/g, "-").toLowerCase();
2646
+ }
2647
+ return fallbackString;
2648
+ };
2641
2649
  var debounce = function debounce(func) {
2642
2650
  var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350;
2643
2651
  var timer;
@@ -3293,6 +3301,7 @@ exports.getSubdomain = getSubdomain;
3293
3301
  exports.hasAllPermissions = hasAllPermissions;
3294
3302
  exports.hasAnyPermission = hasAnyPermission;
3295
3303
  exports.hasPermission = hasPermission;
3304
+ exports.hyphenize = hyphenize;
3296
3305
  exports.joinHyphenCase = joinHyphenCase;
3297
3306
  exports.removeFromLocalStorage = removeFromLocalStorage;
3298
3307
  exports.resetAuthTokens = resetAuthTokens;