@wikicasa-dev/utilities 1.0.20 → 1.0.21

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=(r,t)=>{t||(t=navigator.language);const e=Intl.NumberFormat(t).format(1111).replace(/\p{Number}/gu,""),a=Intl.NumberFormat(t).format(1.1).replace(/\p{Number}/gu,""),n=parseFloat(`${r}`.replace(new RegExp("\\"+e,"g"),"").replace(new RegExp("\\"+a),"."));return isNaN(n)?"":n},u=(r,t,e="it-IT")=>{if(r==null)return;if(r=parseFloat(`${r}`),isNaN(r))return"";const a={style:"currency",currency:"EUR"};let o={...{maximumFractionDigits:0}};return t?.currency&&(o={...o,...a}),new Intl.NumberFormat(e,{...o}).format(r)},c=(r,t)=>u(r,t,navigator.language);function f(r,t=!1){return r==null?"":i(t?Math.round(r):Math.floor(r),0)}function i(r,t){return!r&&r!==0?"":r.toLocaleString("it-IT",{minimumFractionDigits:t,maximumFractionDigits:t})}function s(r,t=2){return i(r,t)}const l={formatFn:r=>u(r)??"",unFormatFn:r=>m(r)};exports.formatFloat=s;exports.formatInteger=f;exports.formatLocaleNumber=u;exports.formatLocaleNumberAuto=c;exports.formatNumber=i;exports.formatterNumberObj=l;exports.parseLocaleNumber=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=(r,t="it-IT")=>{const e=Intl.NumberFormat(t).format(1111).replace(/\p{Number}/gu,""),a=Intl.NumberFormat(t).format(1.1).replace(/\p{Number}/gu,""),o=parseFloat(`${r}`.replace(new RegExp("\\"+e,"g"),"").replace(new RegExp("\\"+a),"."));return isNaN(o)?"":o},i=r=>u(r,navigator.language),c=(r,t,e="it-IT")=>{if(r==null)return;if(r=parseFloat(`${r}`),isNaN(r))return"";const a={style:"currency",currency:"EUR"};let n={...{maximumFractionDigits:0}};return t?.currency&&(n={...n,...a}),new Intl.NumberFormat(e,{...n}).format(r)},f=(r,t)=>c(r,t,navigator.language);function l(r,t=!1){return r==null?"":m(t?Math.round(r):Math.floor(r),0)}function m(r,t){return!r&&r!==0?"":r.toLocaleString("it-IT",{minimumFractionDigits:t,maximumFractionDigits:t})}function s(r,t=2){return m(r,t)}const p={formatFn:r=>c(r)??"",unFormatFn:r=>u(r)};exports.formatFloat=s;exports.formatInteger=l;exports.formatLocaleNumber=c;exports.formatLocaleNumberAuto=f;exports.formatNumber=m;exports.formatterNumberObj=p;exports.parseLocaleNumber=u;exports.parseLocaleNumberAuto=i;
@@ -1,29 +1,28 @@
1
- const c = (r, t) => {
2
- t || (t = navigator.language);
3
- const n = Intl.NumberFormat(t).format(1111).replace(/\p{Number}/gu, ""), e = Intl.NumberFormat(t).format(1.1).replace(/\p{Number}/gu, ""), a = parseFloat(
4
- `${r}`.replace(new RegExp("\\" + n, "g"), "").replace(new RegExp("\\" + e), ".")
1
+ const u = (r, t = "it-IT") => {
2
+ const e = Intl.NumberFormat(t).format(1111).replace(/\p{Number}/gu, ""), n = Intl.NumberFormat(t).format(1.1).replace(/\p{Number}/gu, ""), a = parseFloat(
3
+ `${r}`.replace(new RegExp("\\" + e, "g"), "").replace(new RegExp("\\" + n), ".")
5
4
  );
6
5
  return isNaN(a) ? "" : a;
7
- }, i = (r, t, n = "it-IT") => {
6
+ }, m = (r) => u(r, navigator.language), i = (r, t, e = "it-IT") => {
8
7
  if (r == null)
9
8
  return;
10
9
  if (r = parseFloat(`${r}`), isNaN(r))
11
10
  return "";
12
- const e = {
11
+ const n = {
13
12
  style: "currency",
14
13
  currency: "EUR"
15
14
  };
16
15
  let o = { ...{
17
16
  maximumFractionDigits: 0
18
17
  } };
19
- return t?.currency && (o = { ...o, ...e }), new Intl.NumberFormat(n, {
18
+ return t?.currency && (o = { ...o, ...n }), new Intl.NumberFormat(e, {
20
19
  ...o
21
20
  }).format(r);
22
- }, m = (r, t) => i(r, t, navigator.language);
21
+ }, s = (r, t) => i(r, t, navigator.language);
23
22
  function f(r, t = !1) {
24
- return r == null ? "" : u(t ? Math.round(r) : Math.floor(r), 0);
23
+ return r == null ? "" : c(t ? Math.round(r) : Math.floor(r), 0);
25
24
  }
26
- function u(r, t) {
25
+ function c(r, t) {
27
26
  return !r && r !== 0 ? "" : r.toLocaleString(
28
27
  "it-IT",
29
28
  // usare una stringa tipo 'en-US' per sovrascrivere la lingua del browser
@@ -33,19 +32,20 @@ function u(r, t) {
33
32
  }
34
33
  );
35
34
  }
36
- function s(r, t = 2) {
37
- return u(r, t);
35
+ function l(r, t = 2) {
36
+ return c(r, t);
38
37
  }
39
38
  const p = {
40
39
  formatFn: (r) => i(r) ?? "",
41
- unFormatFn: (r) => c(r)
40
+ unFormatFn: (r) => u(r)
42
41
  };
43
42
  export {
44
- s as formatFloat,
43
+ l as formatFloat,
45
44
  f as formatInteger,
46
45
  i as formatLocaleNumber,
47
- m as formatLocaleNumberAuto,
48
- u as formatNumber,
46
+ s as formatLocaleNumberAuto,
47
+ c as formatNumber,
49
48
  p as formatterNumberObj,
50
- c as parseLocaleNumber
49
+ u as parseLocaleNumber,
50
+ m as parseLocaleNumberAuto
51
51
  };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./ArrayUtils.cjs"),g=require("./ColorUtils.cjs"),i=require("./CookieUtils.cjs"),p=require("./CurrencyUtils.cjs"),l=require("./DateUtils.cjs"),s=require("./DeviceDetectionUtils.cjs"),a=require("./DOMUtils.cjs"),c=require("./EmailUtils.cjs"),E=require("./FunctionUtils.cjs"),m=require("./GenericUtils.cjs"),t=require("./NumberUtils.cjs"),r=require("./ObjectUtils.cjs"),C=require("./ObserverUtils.cjs"),u=require("./PermissionUtils.cjs"),n=require("./RESB_UrlBuilder.cjs"),o=require("./StringUtils.cjs"),R=require("./URLBuilderUtils.cjs"),e=require("./RegexUtils.cjs"),d=require("./GeolocationUtils.cjs"),b=require("./AdressUtils.cjs"),S=require("./GAutocompleteUtils.cjs"),A=require("./DownloadUtils.cjs");exports.isArrNullOrEmpty=O.isArrNullOrEmpty;exports.rgba=g.rgba;exports.decodeCookie=i.decodeCookie;exports.encodeCookie=i.encodeCookie;exports.getCookie=i.getCookie;exports.removeCookie=i.removeCookie;exports.formatCurrency=p.formatCurrency;exports.formatDate=l.formatDate;exports.formatDateToddMMYYYY=l.formatDateToddMMYYYY;exports.subtractDaysFromDate=l.subtractDaysFromDate;exports.getCurrentDeviceSize=s.getCurrentDeviceSize;exports.isMobile=s.isMobile;exports.isSafari=s.isSafari;exports.isiOSDevice=s.isiOSDevice;exports.emptyElem=a.emptyElem;exports.getSingleElement=a.getSingleElement;exports.hideElem=a.hideElem;exports.showElem=a.showElem;exports.hash256=c.hash256;exports.hashEmail=c.hashEmail;exports.debounce=E.debounce;exports.isPromise=E.isPromise;exports.awaitableSetTimeout=m.awaitableSetTimeout;exports.createCustomEvent=m.createCustomEvent;exports.formatFloat=t.formatFloat;exports.formatInteger=t.formatInteger;exports.formatLocaleNumber=t.formatLocaleNumber;exports.formatLocaleNumberAuto=t.formatLocaleNumberAuto;exports.formatNumber=t.formatNumber;exports.formatterNumberObj=t.formatterNumberObj;exports.parseLocaleNumber=t.parseLocaleNumber;exports.deepCopy=r.deepCopy;exports.getOrNull=r.getOrNull;exports.invertFlatObject=r.invertFlatObject;exports.invertKeyToValue=r.invertKeyToValue;exports.isEmptyObject=r.isEmptyObject;exports.shallowCopyObjectTo=r.shallowCopyObjectTo;exports.observeOnce=C.observeOnce;exports.addPermissionStateListener=u.addPermissionStateListener;exports.onNotificationsPermissionChange=u.onNotificationsPermissionChange;exports.buildParams=n.buildParams;exports.buildParamsForAgency=n.buildParamsForAgency;exports.buildURL=n.buildURL;exports.capitalizeFirstLetter=o.capitalizeFirstLetter;exports.cleanASCII=o.cleanASCII;exports.decodeTextWithEntities=o.decodeTextWithEntities;exports.replaceAll=o.replaceAll;exports.replaceAllTokens=o.replaceAllTokens;exports.stringToHyphened=o.stringToHyphened;exports.appendQueryString=R.appendQueryString;exports.COMPETITOR_REGEX=e.COMPETITOR_REGEX;exports.DATE_REGEX=e.DATE_REGEX;exports.EMAIL_REGEX=e.EMAIL_REGEX;exports.EMAIL_REGEX_INTO_TEXT=e.EMAIL_REGEX_INTO_TEXT;exports.EXCLUDED_REGEX=e.EXCLUDED_REGEX;exports.GLOBAL_PHONE_REGEX=e.GLOBAL_PHONE_REGEX;exports.PASSWORD_REGEX=e.PASSWORD_REGEX;exports.PHONE_REGEX=e.PHONE_REGEX;exports.ROOMS_REGEX=e.ROOMS_REGEX;exports.SQM_REGEX=e.SQM_REGEX;exports.browserSupportGeolocation=d.browserSupportGeolocation;exports.getUserPosition=d.getUserPosition;exports.formatAddress=b.formatAddress;exports.formattedAddress=b.formattedAddress;exports.googlePlaceConverter=S.googlePlaceConverter;exports.downloadFile=A.downloadFile;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./ArrayUtils.cjs"),p=require("./ColorUtils.cjs"),i=require("./CookieUtils.cjs"),g=require("./CurrencyUtils.cjs"),l=require("./DateUtils.cjs"),s=require("./DeviceDetectionUtils.cjs"),a=require("./DOMUtils.cjs"),c=require("./EmailUtils.cjs"),E=require("./FunctionUtils.cjs"),u=require("./GenericUtils.cjs"),t=require("./NumberUtils.cjs"),r=require("./ObjectUtils.cjs"),A=require("./ObserverUtils.cjs"),m=require("./PermissionUtils.cjs"),n=require("./RESB_UrlBuilder.cjs"),o=require("./StringUtils.cjs"),C=require("./URLBuilderUtils.cjs"),e=require("./RegexUtils.cjs"),d=require("./GeolocationUtils.cjs"),b=require("./AdressUtils.cjs"),R=require("./GAutocompleteUtils.cjs"),S=require("./DownloadUtils.cjs");exports.isArrNullOrEmpty=O.isArrNullOrEmpty;exports.rgba=p.rgba;exports.decodeCookie=i.decodeCookie;exports.encodeCookie=i.encodeCookie;exports.getCookie=i.getCookie;exports.removeCookie=i.removeCookie;exports.formatCurrency=g.formatCurrency;exports.formatDate=l.formatDate;exports.formatDateToddMMYYYY=l.formatDateToddMMYYYY;exports.subtractDaysFromDate=l.subtractDaysFromDate;exports.getCurrentDeviceSize=s.getCurrentDeviceSize;exports.isMobile=s.isMobile;exports.isSafari=s.isSafari;exports.isiOSDevice=s.isiOSDevice;exports.emptyElem=a.emptyElem;exports.getSingleElement=a.getSingleElement;exports.hideElem=a.hideElem;exports.showElem=a.showElem;exports.hash256=c.hash256;exports.hashEmail=c.hashEmail;exports.debounce=E.debounce;exports.isPromise=E.isPromise;exports.awaitableSetTimeout=u.awaitableSetTimeout;exports.createCustomEvent=u.createCustomEvent;exports.formatFloat=t.formatFloat;exports.formatInteger=t.formatInteger;exports.formatLocaleNumber=t.formatLocaleNumber;exports.formatLocaleNumberAuto=t.formatLocaleNumberAuto;exports.formatNumber=t.formatNumber;exports.formatterNumberObj=t.formatterNumberObj;exports.parseLocaleNumber=t.parseLocaleNumber;exports.parseLocaleNumberAuto=t.parseLocaleNumberAuto;exports.deepCopy=r.deepCopy;exports.getOrNull=r.getOrNull;exports.invertFlatObject=r.invertFlatObject;exports.invertKeyToValue=r.invertKeyToValue;exports.isEmptyObject=r.isEmptyObject;exports.shallowCopyObjectTo=r.shallowCopyObjectTo;exports.observeOnce=A.observeOnce;exports.addPermissionStateListener=m.addPermissionStateListener;exports.onNotificationsPermissionChange=m.onNotificationsPermissionChange;exports.buildParams=n.buildParams;exports.buildParamsForAgency=n.buildParamsForAgency;exports.buildURL=n.buildURL;exports.capitalizeFirstLetter=o.capitalizeFirstLetter;exports.cleanASCII=o.cleanASCII;exports.decodeTextWithEntities=o.decodeTextWithEntities;exports.replaceAll=o.replaceAll;exports.replaceAllTokens=o.replaceAllTokens;exports.stringToHyphened=o.stringToHyphened;exports.appendQueryString=C.appendQueryString;exports.COMPETITOR_REGEX=e.COMPETITOR_REGEX;exports.DATE_REGEX=e.DATE_REGEX;exports.EMAIL_REGEX=e.EMAIL_REGEX;exports.EMAIL_REGEX_INTO_TEXT=e.EMAIL_REGEX_INTO_TEXT;exports.EXCLUDED_REGEX=e.EXCLUDED_REGEX;exports.GLOBAL_PHONE_REGEX=e.GLOBAL_PHONE_REGEX;exports.PASSWORD_REGEX=e.PASSWORD_REGEX;exports.PHONE_REGEX=e.PHONE_REGEX;exports.ROOMS_REGEX=e.ROOMS_REGEX;exports.SQM_REGEX=e.SQM_REGEX;exports.browserSupportGeolocation=d.browserSupportGeolocation;exports.getUserPosition=d.getUserPosition;exports.formatAddress=b.formatAddress;exports.formattedAddress=b.formattedAddress;exports.googlePlaceConverter=R.googlePlaceConverter;exports.downloadFile=S.downloadFile;
package/dist/index.js CHANGED
@@ -1,55 +1,55 @@
1
1
  import { isArrNullOrEmpty as r } from "./ArrayUtils.js";
2
2
  import { rgba as m } from "./ColorUtils.js";
3
- import { decodeCookie as i, encodeCookie as E, getCookie as p, removeCookie as l } from "./CookieUtils.js";
4
- import { formatCurrency as s } from "./CurrencyUtils.js";
3
+ import { decodeCookie as i, encodeCookie as p, getCookie as E, removeCookie as l } from "./CookieUtils.js";
4
+ import { formatCurrency as f } from "./CurrencyUtils.js";
5
5
  import { formatDate as c, formatDateToddMMYYYY as d, subtractDaysFromDate as x } from "./DateUtils.js";
6
- import { getCurrentDeviceSize as b, isMobile as O, isSafari as g, isiOSDevice as C } from "./DeviceDetectionUtils.js";
7
- import { emptyElem as A, getSingleElement as S, hideElem as T, showElem as _ } from "./DOMUtils.js";
8
- import { hash256 as X, hashEmail as y } from "./EmailUtils.js";
9
- import { debounce as N, isPromise as P } from "./FunctionUtils.js";
6
+ import { getCurrentDeviceSize as b, isMobile as O, isSafari as g, isiOSDevice as A } from "./DeviceDetectionUtils.js";
7
+ import { emptyElem as R, getSingleElement as S, hideElem as T, showElem as _ } from "./DOMUtils.js";
8
+ import { hash256 as L, hashEmail as N } from "./EmailUtils.js";
9
+ import { debounce as y, isPromise as P } from "./FunctionUtils.js";
10
10
  import { awaitableSetTimeout as D, createCustomEvent as v } from "./GenericUtils.js";
11
- import { formatFloat as I, formatInteger as F, formatLocaleNumber as k, formatLocaleNumberAuto as w, formatNumber as j, formatterNumberObj as Y, parseLocaleNumber as H } from "./NumberUtils.js";
12
- import { deepCopy as z, getOrNull as Q, invertFlatObject as W, invertKeyToValue as B, isEmptyObject as K, shallowCopyObjectTo as V } from "./ObjectUtils.js";
13
- import { observeOnce as J } from "./ObserverUtils.js";
14
- import { addPermissionStateListener as $, onNotificationsPermissionChange as ee } from "./PermissionUtils.js";
15
- import { buildParams as re, buildParamsForAgency as te, buildURL as me } from "./RESB_UrlBuilder.js";
16
- import { capitalizeFirstLetter as ie, cleanASCII as Ee, decodeTextWithEntities as pe, replaceAll as le, replaceAllTokens as fe, stringToHyphened as se } from "./StringUtils.js";
17
- import { appendQueryString as ce } from "./URLBuilderUtils.js";
18
- import { COMPETITOR_REGEX as xe, DATE_REGEX as ue, EMAIL_REGEX as be, EMAIL_REGEX_INTO_TEXT as Oe, EXCLUDED_REGEX as ge, GLOBAL_PHONE_REGEX as Ce, PASSWORD_REGEX as Re, PHONE_REGEX as Ae, ROOMS_REGEX as Se, SQM_REGEX as Te } from "./RegexUtils.js";
19
- import { browserSupportGeolocation as Ge, getUserPosition as Xe } from "./GeolocationUtils.js";
20
- import { formatAddress as Le, formattedAddress as Ne } from "./AdressUtils.js";
21
- import { googlePlaceConverter as he } from "./GAutocompleteUtils.js";
22
- import { downloadFile as ve } from "./DownloadUtils.js";
11
+ import { formatFloat as I, formatInteger as F, formatLocaleNumber as k, formatLocaleNumberAuto as w, formatNumber as j, formatterNumberObj as Y, parseLocaleNumber as H, parseLocaleNumberAuto as U } from "./NumberUtils.js";
12
+ import { deepCopy as Q, getOrNull as W, invertFlatObject as B, invertKeyToValue as K, isEmptyObject as V, shallowCopyObjectTo as q } from "./ObjectUtils.js";
13
+ import { observeOnce as Z } from "./ObserverUtils.js";
14
+ import { addPermissionStateListener as ee, onNotificationsPermissionChange as oe } from "./PermissionUtils.js";
15
+ import { buildParams as te, buildParamsForAgency as me, buildURL as ae } from "./RESB_UrlBuilder.js";
16
+ import { capitalizeFirstLetter as pe, cleanASCII as Ee, decodeTextWithEntities as le, replaceAll as se, replaceAllTokens as fe, stringToHyphened as ne } from "./StringUtils.js";
17
+ import { appendQueryString as de } from "./URLBuilderUtils.js";
18
+ import { COMPETITOR_REGEX as ue, DATE_REGEX as be, EMAIL_REGEX as Oe, EMAIL_REGEX_INTO_TEXT as ge, EXCLUDED_REGEX as Ae, GLOBAL_PHONE_REGEX as Ce, PASSWORD_REGEX as Re, PHONE_REGEX as Se, ROOMS_REGEX as Te, SQM_REGEX as _e } from "./RegexUtils.js";
19
+ import { browserSupportGeolocation as Le, getUserPosition as Ne } from "./GeolocationUtils.js";
20
+ import { formatAddress as ye, formattedAddress as Pe } from "./AdressUtils.js";
21
+ import { googlePlaceConverter as De } from "./GAutocompleteUtils.js";
22
+ import { downloadFile as Me } from "./DownloadUtils.js";
23
23
  export {
24
- xe as COMPETITOR_REGEX,
25
- ue as DATE_REGEX,
26
- be as EMAIL_REGEX,
27
- Oe as EMAIL_REGEX_INTO_TEXT,
28
- ge as EXCLUDED_REGEX,
24
+ ue as COMPETITOR_REGEX,
25
+ be as DATE_REGEX,
26
+ Oe as EMAIL_REGEX,
27
+ ge as EMAIL_REGEX_INTO_TEXT,
28
+ Ae as EXCLUDED_REGEX,
29
29
  Ce as GLOBAL_PHONE_REGEX,
30
30
  Re as PASSWORD_REGEX,
31
- Ae as PHONE_REGEX,
32
- Se as ROOMS_REGEX,
33
- Te as SQM_REGEX,
34
- $ as addPermissionStateListener,
35
- ce as appendQueryString,
31
+ Se as PHONE_REGEX,
32
+ Te as ROOMS_REGEX,
33
+ _e as SQM_REGEX,
34
+ ee as addPermissionStateListener,
35
+ de as appendQueryString,
36
36
  D as awaitableSetTimeout,
37
- Ge as browserSupportGeolocation,
38
- re as buildParams,
39
- te as buildParamsForAgency,
40
- me as buildURL,
41
- ie as capitalizeFirstLetter,
37
+ Le as browserSupportGeolocation,
38
+ te as buildParams,
39
+ me as buildParamsForAgency,
40
+ ae as buildURL,
41
+ pe as capitalizeFirstLetter,
42
42
  Ee as cleanASCII,
43
43
  v as createCustomEvent,
44
- N as debounce,
44
+ y as debounce,
45
45
  i as decodeCookie,
46
- pe as decodeTextWithEntities,
47
- z as deepCopy,
48
- ve as downloadFile,
49
- A as emptyElem,
50
- E as encodeCookie,
51
- Le as formatAddress,
52
- s as formatCurrency,
46
+ le as decodeTextWithEntities,
47
+ Q as deepCopy,
48
+ Me as downloadFile,
49
+ R as emptyElem,
50
+ p as encodeCookie,
51
+ ye as formatAddress,
52
+ f as formatCurrency,
53
53
  c as formatDate,
54
54
  d as formatDateToddMMYYYY,
55
55
  I as formatFloat,
@@ -57,34 +57,35 @@ export {
57
57
  k as formatLocaleNumber,
58
58
  w as formatLocaleNumberAuto,
59
59
  j as formatNumber,
60
- Ne as formattedAddress,
60
+ Pe as formattedAddress,
61
61
  Y as formatterNumberObj,
62
- p as getCookie,
62
+ E as getCookie,
63
63
  b as getCurrentDeviceSize,
64
- Q as getOrNull,
64
+ W as getOrNull,
65
65
  S as getSingleElement,
66
- Xe as getUserPosition,
67
- he as googlePlaceConverter,
68
- X as hash256,
69
- y as hashEmail,
66
+ Ne as getUserPosition,
67
+ De as googlePlaceConverter,
68
+ L as hash256,
69
+ N as hashEmail,
70
70
  T as hideElem,
71
- W as invertFlatObject,
72
- B as invertKeyToValue,
71
+ B as invertFlatObject,
72
+ K as invertKeyToValue,
73
73
  r as isArrNullOrEmpty,
74
- K as isEmptyObject,
74
+ V as isEmptyObject,
75
75
  O as isMobile,
76
76
  P as isPromise,
77
77
  g as isSafari,
78
- C as isiOSDevice,
79
- J as observeOnce,
80
- ee as onNotificationsPermissionChange,
78
+ A as isiOSDevice,
79
+ Z as observeOnce,
80
+ oe as onNotificationsPermissionChange,
81
81
  H as parseLocaleNumber,
82
+ U as parseLocaleNumberAuto,
82
83
  l as removeCookie,
83
- le as replaceAll,
84
+ se as replaceAll,
84
85
  fe as replaceAllTokens,
85
86
  m as rgba,
86
- V as shallowCopyObjectTo,
87
+ q as shallowCopyObjectTo,
87
88
  _ as showElem,
88
- se as stringToHyphened,
89
+ ne as stringToHyphened,
89
90
  x as subtractDaysFromDate
90
91
  };
@@ -1,12 +1,17 @@
1
+ export declare const parseLocaleNumber: (stringNumber: string, locale?: Intl.LocalesArgument) => number | string | null;
1
2
  /**
2
- * Parse a localized number to a float.
3
- * @param stringNumber - the localized number
4
- * @param locale - [optional] the locale that the number is represented in. Omit this parameter to use the current locale.
3
+ * Automatically parses a string number to a number according to the user's locale settings.
4
+ *
5
+ * Utilizes `parseLocaleNumber` to parse the provided string number with optional currency parsing.
6
+ * The locale is determined using the user's browser language settings.
7
+ *
8
+ * @param stringNumber - The string number to parse
9
+ * @returns The parsed number, or undefined if the input is invalid
5
10
  */
6
- export declare const parseLocaleNumber: (stringNumber: string, locale?: string) => number | string | null;
11
+ export declare const parseLocaleNumberAuto: (stringNumber: string) => string | number | null;
7
12
  export declare const formatLocaleNumber: (numberToFormat?: number | string, props?: {
8
13
  currency: boolean;
9
- }, lang?: string) => string | undefined | null;
14
+ }, lang?: Intl.LocalesArgument) => string | undefined | null;
10
15
  /**
11
16
  * Automatically formats a number according to the user's locale settings.
12
17
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/utilities",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "Wikicasa frontend utilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",