@hybridly/utils 0.0.1-alpha.19 → 0.0.1-alpha.20

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/dist/index.cjs CHANGED
@@ -311,6 +311,9 @@ function when(condition, data, _default) {
311
311
  function merge(x, y) {
312
312
  return baseMerge__default(x, y, { arrayMerge: (_, s) => s });
313
313
  }
314
+ function removeTrailingSlash(string) {
315
+ return string.replace(/\/+$/, "");
316
+ }
314
317
 
315
318
  const debug = {
316
319
  router: makeDebugger__default("hybridly:core:router"),
@@ -332,6 +335,7 @@ exports.match = match;
332
335
  exports.merge = merge;
333
336
  exports.objectToFormData = objectToFormData;
334
337
  exports.random = random;
338
+ exports.removeTrailingSlash = removeTrailingSlash;
335
339
  exports.showPageComponentErrorModal = showPageComponentErrorModal;
336
340
  exports.showResponseErrorModal = showResponseErrorModal;
337
341
  exports.value = value;
package/dist/index.d.ts CHANGED
@@ -40,6 +40,7 @@ declare function debounce<F extends (...params: any[]) => ReturnType<F>>(fn: F,
40
40
  declare function value<T>(value: T | (() => T)): T;
41
41
  declare function when<T, D>(condition: any, data: T, _default?: D): T | D | undefined;
42
42
  declare function merge<T>(x: Partial<T>, y: Partial<T>): T;
43
+ declare function removeTrailingSlash(string: string): string;
43
44
 
44
45
  declare const debug: {
45
46
  router: makeDebugger.Debugger;
@@ -53,4 +54,4 @@ declare const debug: {
53
54
  adapter: (name: string, ...args: any[]) => void;
54
55
  };
55
56
 
56
- export { FormDataConvertible, RequestData, debounce, debug, hasFiles, match, merge, objectToFormData, random, showPageComponentErrorModal, showResponseErrorModal, value, when };
57
+ export { FormDataConvertible, RequestData, debounce, debug, hasFiles, match, merge, objectToFormData, random, removeTrailingSlash, showPageComponentErrorModal, showResponseErrorModal, value, when };
package/dist/index.mjs CHANGED
@@ -301,6 +301,9 @@ function when(condition, data, _default) {
301
301
  function merge(x, y) {
302
302
  return baseMerge(x, y, { arrayMerge: (_, s) => s });
303
303
  }
304
+ function removeTrailingSlash(string) {
305
+ return string.replace(/\/+$/, "");
306
+ }
304
307
 
305
308
  const debug = {
306
309
  router: makeDebugger("hybridly:core:router"),
@@ -314,4 +317,4 @@ const debug = {
314
317
  adapter: (name, ...args) => makeDebugger("hybridly:adapter").extend(name)(args.shift(), ...args)
315
318
  };
316
319
 
317
- export { debounce, debug, hasFiles, match, merge, objectToFormData, random, showPageComponentErrorModal, showResponseErrorModal, value, when };
320
+ export { debounce, debug, hasFiles, match, merge, objectToFormData, random, removeTrailingSlash, showPageComponentErrorModal, showResponseErrorModal, value, when };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hybridly/utils",
3
- "version": "0.0.1-alpha.19",
3
+ "version": "0.0.1-alpha.20",
4
4
  "description": "A solution to develop server-driven, client-rendered applications",
5
5
  "keywords": [
6
6
  "hybridly",