@bigbinary/neeto-commons-frontend 2.1.33 → 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/README.md +2 -0
- package/initializers.cjs.js +81 -17
- package/initializers.cjs.js.map +1 -1
- package/initializers.js +82 -18
- package/initializers.js.map +1 -1
- package/package.json +1 -1
- package/utils.cjs.js +13 -0
- package/utils.cjs.js.map +1 -1
- package/utils.d.ts +24 -0
- package/utils.js +12 -1
- package/utils.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-commons-frontend",
|
|
3
|
-
"version": "2.1.
|
|
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;
|
|
@@ -2661,6 +2669,9 @@ var getFromLocalStorage = function getFromLocalStorage(key) {
|
|
|
2661
2669
|
var setToLocalStorage = function setToLocalStorage(key, value) {
|
|
2662
2670
|
if (ramda.isNotNil(value)) localStorage.setItem(key, JSON.stringify(value));else localStorage.removeItem(key);
|
|
2663
2671
|
};
|
|
2672
|
+
var removeFromLocalStorage = function removeFromLocalStorage(key) {
|
|
2673
|
+
localStorage.removeItem(key);
|
|
2674
|
+
};
|
|
2664
2675
|
|
|
2665
2676
|
dayjs__default["default"].extend(relativeTime__default["default"]);
|
|
2666
2677
|
dayjs__default["default"].extend(updateLocale__default["default"]);
|
|
@@ -3290,7 +3301,9 @@ exports.getSubdomain = getSubdomain;
|
|
|
3290
3301
|
exports.hasAllPermissions = hasAllPermissions;
|
|
3291
3302
|
exports.hasAnyPermission = hasAnyPermission;
|
|
3292
3303
|
exports.hasPermission = hasPermission;
|
|
3304
|
+
exports.hyphenize = hyphenize;
|
|
3293
3305
|
exports.joinHyphenCase = joinHyphenCase;
|
|
3306
|
+
exports.removeFromLocalStorage = removeFromLocalStorage;
|
|
3294
3307
|
exports.resetAuthTokens = resetAuthTokens;
|
|
3295
3308
|
exports.setToLocalStorage = setToLocalStorage;
|
|
3296
3309
|
exports.simulateApiCall = simulateApiCall;
|