@wikicasa-dev/utilities 1.0.20 → 1.0.22

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 e=require("./types-D0iZP-MN.cjs"),r=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,n=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),o=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=(t={sm:e.f.SMALL,md:e.f.MEDIUM,lg:e.f.LARGE,xl:e.f.EXTRA_LARGE})=>{const i=t;return window.innerWidth<i.sm?"mobile":window.innerWidth<i.lg?"tablet":"desktop"};exports.getCurrentDeviceSize=s;exports.isMobile=n;exports.isSafari=o;exports.isiOSDevice=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./types-D0iZP-MN.cjs"),n=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window?.MSStream,r=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator?.userAgent),o=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=()=>navigator?.userAgent.includes("Windows"),a=(t={sm:i.f.SMALL,md:i.f.MEDIUM,lg:i.f.LARGE,xl:i.f.EXTRA_LARGE})=>{const e=t;return window?.innerWidth<e.sm?"mobile":window?.innerWidth<e.lg?"tablet":"desktop"};exports.getCurrentDeviceSize=a;exports.isMobile=r;exports.isSafari=o;exports.isWindows=s;exports.isiOSDevice=n;
@@ -1,18 +1,19 @@
1
1
  import { f as i } from "./types-B0dZ7OiV.js";
2
- const n = () => /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, o = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
3
- navigator.userAgent
4
- ), s = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent), a = (t = {
2
+ const r = () => /iPad|iPhone|iPod/.test(navigator.userAgent) && !window?.MSStream, o = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
3
+ navigator?.userAgent
4
+ ), s = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent), a = () => navigator?.userAgent.includes("Windows"), d = (n = {
5
5
  sm: i.SMALL,
6
6
  md: i.MEDIUM,
7
7
  lg: i.LARGE,
8
8
  xl: i.EXTRA_LARGE
9
9
  }) => {
10
- const e = t;
11
- return window.innerWidth < e.sm ? "mobile" : window.innerWidth < e.lg ? "tablet" : "desktop";
10
+ const e = n;
11
+ return window?.innerWidth < e.sm ? "mobile" : window?.innerWidth < e.lg ? "tablet" : "desktop";
12
12
  };
13
13
  export {
14
- a as getCurrentDeviceSize,
14
+ d as getCurrentDeviceSize,
15
15
  o as isMobile,
16
16
  s as isSafari,
17
- n as isiOSDevice
17
+ a as isWindows,
18
+ r as isiOSDevice
18
19
  };
@@ -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"),s=require("./CookieUtils.cjs"),g=require("./CurrencyUtils.cjs"),l=require("./DateUtils.cjs"),i=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=s.decodeCookie;exports.encodeCookie=s.encodeCookie;exports.getCookie=s.getCookie;exports.removeCookie=s.removeCookie;exports.formatCurrency=g.formatCurrency;exports.formatDate=l.formatDate;exports.formatDateToddMMYYYY=l.formatDateToddMMYYYY;exports.subtractDaysFromDate=l.subtractDaysFromDate;exports.getCurrentDeviceSize=i.getCurrentDeviceSize;exports.isMobile=i.isMobile;exports.isSafari=i.isSafari;exports.isWindows=i.isWindows;exports.isiOSDevice=i.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,90 +1,92 @@
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 s, removeCookie as E } 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";
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";
6
+ import { getCurrentDeviceSize as b, isMobile as O, isSafari as g, isWindows as A, isiOSDevice as C } from "./DeviceDetectionUtils.js";
7
+ import { emptyElem as S, getSingleElement as T, hideElem as _, showElem as G } from "./DOMUtils.js";
8
+ import { hash256 as N, hashEmail as X } from "./EmailUtils.js";
9
+ import { debounce as P, isPromise as h } from "./FunctionUtils.js";
10
+ import { awaitableSetTimeout as v, createCustomEvent as M } from "./GenericUtils.js";
11
+ import { formatFloat as w, formatInteger as F, formatLocaleNumber as k, formatLocaleNumberAuto as j, formatNumber as Y, formatterNumberObj as H, parseLocaleNumber as U, parseLocaleNumberAuto as W } from "./NumberUtils.js";
12
+ import { deepCopy as Q, getOrNull as B, invertFlatObject as K, invertKeyToValue as V, isEmptyObject as q, shallowCopyObjectTo as J } from "./ObjectUtils.js";
13
+ import { observeOnce as $ } from "./ObserverUtils.js";
14
+ import { addPermissionStateListener as oe, onNotificationsPermissionChange as re } from "./PermissionUtils.js";
15
+ import { buildParams as me, buildParamsForAgency as ae, buildURL as ie } from "./RESB_UrlBuilder.js";
16
+ import { capitalizeFirstLetter as se, cleanASCII as Ee, decodeTextWithEntities as le, replaceAll as fe, replaceAllTokens as ne, stringToHyphened as ce } from "./StringUtils.js";
17
+ import { appendQueryString as xe } from "./URLBuilderUtils.js";
18
+ import { COMPETITOR_REGEX as be, DATE_REGEX as Oe, EMAIL_REGEX as ge, EMAIL_REGEX_INTO_TEXT as Ae, EXCLUDED_REGEX as Ce, GLOBAL_PHONE_REGEX as Re, PASSWORD_REGEX as Se, PHONE_REGEX as Te, ROOMS_REGEX as _e, SQM_REGEX as Ge } from "./RegexUtils.js";
19
+ import { browserSupportGeolocation as Ne, getUserPosition as Xe } from "./GeolocationUtils.js";
20
+ import { formatAddress as Pe, formattedAddress as he } from "./AdressUtils.js";
21
+ import { googlePlaceConverter as ve } from "./GAutocompleteUtils.js";
22
+ import { downloadFile as Ie } 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,
29
- Ce as GLOBAL_PHONE_REGEX,
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,
36
- D as awaitableSetTimeout,
37
- Ge as browserSupportGeolocation,
38
- re as buildParams,
39
- te as buildParamsForAgency,
40
- me as buildURL,
41
- ie as capitalizeFirstLetter,
24
+ be as COMPETITOR_REGEX,
25
+ Oe as DATE_REGEX,
26
+ ge as EMAIL_REGEX,
27
+ Ae as EMAIL_REGEX_INTO_TEXT,
28
+ Ce as EXCLUDED_REGEX,
29
+ Re as GLOBAL_PHONE_REGEX,
30
+ Se as PASSWORD_REGEX,
31
+ Te as PHONE_REGEX,
32
+ _e as ROOMS_REGEX,
33
+ Ge as SQM_REGEX,
34
+ oe as addPermissionStateListener,
35
+ xe as appendQueryString,
36
+ v as awaitableSetTimeout,
37
+ Ne as browserSupportGeolocation,
38
+ me as buildParams,
39
+ ae as buildParamsForAgency,
40
+ ie as buildURL,
41
+ se as capitalizeFirstLetter,
42
42
  Ee as cleanASCII,
43
- v as createCustomEvent,
44
- N as debounce,
43
+ M as createCustomEvent,
44
+ P 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
+ Ie as downloadFile,
49
+ S as emptyElem,
50
+ p as encodeCookie,
51
+ Pe as formatAddress,
52
+ f as formatCurrency,
53
53
  c as formatDate,
54
54
  d as formatDateToddMMYYYY,
55
- I as formatFloat,
55
+ w as formatFloat,
56
56
  F as formatInteger,
57
57
  k as formatLocaleNumber,
58
- w as formatLocaleNumberAuto,
59
- j as formatNumber,
60
- Ne as formattedAddress,
61
- Y as formatterNumberObj,
62
- p as getCookie,
58
+ j as formatLocaleNumberAuto,
59
+ Y as formatNumber,
60
+ he as formattedAddress,
61
+ H as formatterNumberObj,
62
+ s as getCookie,
63
63
  b as getCurrentDeviceSize,
64
- Q as getOrNull,
65
- S as getSingleElement,
64
+ B as getOrNull,
65
+ T as getSingleElement,
66
66
  Xe as getUserPosition,
67
- he as googlePlaceConverter,
68
- X as hash256,
69
- y as hashEmail,
70
- T as hideElem,
71
- W as invertFlatObject,
72
- B as invertKeyToValue,
67
+ ve as googlePlaceConverter,
68
+ N as hash256,
69
+ X as hashEmail,
70
+ _ as hideElem,
71
+ K as invertFlatObject,
72
+ V as invertKeyToValue,
73
73
  r as isArrNullOrEmpty,
74
- K as isEmptyObject,
74
+ q as isEmptyObject,
75
75
  O as isMobile,
76
- P as isPromise,
76
+ h as isPromise,
77
77
  g as isSafari,
78
+ A as isWindows,
78
79
  C as isiOSDevice,
79
- J as observeOnce,
80
- ee as onNotificationsPermissionChange,
81
- H as parseLocaleNumber,
82
- l as removeCookie,
83
- le as replaceAll,
84
- fe as replaceAllTokens,
80
+ $ as observeOnce,
81
+ re as onNotificationsPermissionChange,
82
+ U as parseLocaleNumber,
83
+ W as parseLocaleNumberAuto,
84
+ E as removeCookie,
85
+ fe as replaceAll,
86
+ ne as replaceAllTokens,
85
87
  m as rgba,
86
- V as shallowCopyObjectTo,
87
- _ as showElem,
88
- se as stringToHyphened,
88
+ J as shallowCopyObjectTo,
89
+ G as showElem,
90
+ ce as stringToHyphened,
89
91
  x as subtractDaysFromDate
90
92
  };
@@ -16,6 +16,7 @@ export declare const isMobile: () => boolean;
16
16
  * @returns {boolean} Returns true if the browser is Safari, false otherwise.
17
17
  */
18
18
  export declare const isSafari: () => boolean;
19
+ export declare const isWindows: () => boolean;
19
20
  type BreakpointType = {
20
21
  sm: number;
21
22
  md: number;
@@ -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.22",
4
4
  "description": "Wikicasa frontend utilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",