@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/README.md +1 -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 +9 -0
- package/utils.cjs.js.map +1 -1
- package/utils.d.ts +12 -0
- package/utils.js +9 -1
- package/utils.js.map +1 -1
package/utils.d.ts
CHANGED
|
@@ -290,6 +290,18 @@ export function getQueryParams(options?: qsOptionsType): QueryParamsType;
|
|
|
290
290
|
* @endexample
|
|
291
291
|
*/
|
|
292
292
|
export function joinHyphenCase(...args: string[]): string;
|
|
293
|
+
/**
|
|
294
|
+
*
|
|
295
|
+
* The hyphenize function converts strings that contain underscores, spaces, and
|
|
296
|
+
*
|
|
297
|
+
* camelCase strings into hyphenized strings
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
*
|
|
301
|
+
* hyphenize("hello_world", ""); // output: "hello-world"
|
|
302
|
+
* @endexample
|
|
303
|
+
*/
|
|
304
|
+
export function hyphenize(value: string, fallbackString?: string): string;
|
|
293
305
|
/**
|
|
294
306
|
*
|
|
295
307
|
* The debounce function is used to create a debounced function that delays the
|
package/utils.js
CHANGED
|
@@ -2625,6 +2625,14 @@ var joinHyphenCase = function joinHyphenCase() {
|
|
|
2625
2625
|
}
|
|
2626
2626
|
return args.join(" ").replace(/\s+/g, "-").toLowerCase();
|
|
2627
2627
|
};
|
|
2628
|
+
var hyphenize = function hyphenize(value) {
|
|
2629
|
+
var fallbackString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
2630
|
+
if (typeof value === "number") return String(value);
|
|
2631
|
+
if (value && typeof value === "string" && value.replace) {
|
|
2632
|
+
return value.replace(/[\s_]/g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/-+/g, "-").toLowerCase();
|
|
2633
|
+
}
|
|
2634
|
+
return fallbackString;
|
|
2635
|
+
};
|
|
2628
2636
|
var debounce = function debounce(func) {
|
|
2629
2637
|
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350;
|
|
2630
2638
|
var timer;
|
|
@@ -3268,5 +3276,5 @@ var currencyFormat = {
|
|
|
3268
3276
|
} // 1000, "INR", { maximumFractionDigits: 0 } => ₹1,000 INR
|
|
3269
3277
|
};
|
|
3270
3278
|
|
|
3271
|
-
export { buildUrl, copyToClipboard, createSubscription, currencyFormat, dateFormat, debounce, getFromLocalStorage, getQueryParams, getSubdomain, hasAllPermissions, hasAnyPermission, hasPermission, joinHyphenCase, removeFromLocalStorage, resetAuthTokens, setToLocalStorage, simulateApiCall, timeFormat, toLocale, withEventTargetValue };
|
|
3279
|
+
export { buildUrl, copyToClipboard, createSubscription, currencyFormat, dateFormat, debounce, getFromLocalStorage, getQueryParams, getSubdomain, hasAllPermissions, hasAnyPermission, hasPermission, hyphenize, joinHyphenCase, removeFromLocalStorage, resetAuthTokens, setToLocalStorage, simulateApiCall, timeFormat, toLocale, withEventTargetValue };
|
|
3272
3280
|
//# sourceMappingURL=utils.js.map
|