@wikicasa-dev/utilities 1.0.4 → 1.0.6
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/AdressUtils.cjs +1 -0
- package/dist/AdressUtils.js +12 -0
- package/dist/GAutocompleteUtils.cjs +1 -0
- package/dist/GAutocompleteUtils.js +16 -0
- package/dist/GeolocationUtils.cjs +1 -0
- package/dist/GeolocationUtils.js +19 -0
- package/dist/StringUtils.cjs +1 -1
- package/dist/StringUtils.js +13 -20
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +50 -43
- package/dist/utils/AdressUtils.d.ts +22 -0
- package/dist/utils/GAutocompleteUtils.d.ts +2 -0
- package/dist/utils/GeolocationUtils.d.ts +11 -0
- package/dist/utils/StringUtils.d.ts +6 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./StringUtils.cjs");function f(d,s,o,n){const i=[];d&&d!=="ND"&&(s&&s!=="ND"&&s!=="0"?i.push(`${d} ${s}`):i.push(d)),o&&n?i.push(`${o} (${n})`):i.push(o);const t=i.filter(r=>!!r).join(", ");return l.capitalizeFirstLetter(t)}const u=(d,s,o,n)=>s?f(s,o||"",n):d;exports.formatAddress=f;exports.formattedAddress=u;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { capitalizeFirstLetter as h } from "./StringUtils.js";
|
|
2
|
+
function l(s, o, f, i) {
|
|
3
|
+
const d = [];
|
|
4
|
+
s && s !== "ND" && (o && o !== "ND" && o !== "0" ? d.push(`${s} ${o}`) : d.push(s)), f && i ? d.push(`${f} (${i})`) : d.push(f);
|
|
5
|
+
const n = d.filter((p) => !!p).join(", ");
|
|
6
|
+
return h(n);
|
|
7
|
+
}
|
|
8
|
+
const u = (s, o, f, i) => o ? l(o, f || "", i) : s;
|
|
9
|
+
export {
|
|
10
|
+
l as formatAddress,
|
|
11
|
+
u as formattedAddress
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./StringUtils.cjs"),i=async(t,o,n)=>{const s={};for(let e=0;e<t.address_components.length;e++)t.address_components[e].types.indexOf("administrative_area_level_3")!==-1?s.city=t.address_components[e].long_name:t.address_components[e].types.indexOf("locality")!==-1?s.locality=t.address_components[e].long_name:t.address_components[e].types.indexOf("route")!==-1?s.streetName=t.address_components[e].long_name:t.address_components[e].types.indexOf("street_number")!==-1?s.streetNumber=t.address_components[e].long_name:t.address_components[e].types.indexOf("postal_code")!==-1&&(s.zip=t.address_components[e].long_name);if(s.latitude=t.geometry.location.lat,s.longitude=t.geometry.location.lng,s.address=d.cleanASCII(o),typeof s.streetNumber>"u"&&(s.streetNumber=null),delete n.city,delete n.locality,n={...n,...s},!n.streetNumber){const e=parseInt(n.address.split(",")[1]),r=parseInt(n.zip);e&&e!==r&&(n.streetNumber=e.toString())}return n};exports.googlePlaceConverter=i;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { cleanASCII as d } from "./StringUtils.js";
|
|
2
|
+
const m = async (t, o, n) => {
|
|
3
|
+
const s = {};
|
|
4
|
+
for (let e = 0; e < t.address_components.length; e++)
|
|
5
|
+
t.address_components[e].types.indexOf(
|
|
6
|
+
"administrative_area_level_3"
|
|
7
|
+
) !== -1 ? s.city = t.address_components[e].long_name : t.address_components[e].types.indexOf("locality") !== -1 ? s.locality = t.address_components[e].long_name : t.address_components[e].types.indexOf("route") !== -1 ? s.streetName = t.address_components[e].long_name : t.address_components[e].types.indexOf("street_number") !== -1 ? s.streetNumber = t.address_components[e].long_name : t.address_components[e].types.indexOf("postal_code") !== -1 && (s.zip = t.address_components[e].long_name);
|
|
8
|
+
if (s.latitude = t.geometry.location.lat, s.longitude = t.geometry.location.lng, s.address = d(o), typeof s.streetNumber > "u" && (s.streetNumber = null), delete n.city, delete n.locality, n = { ...n, ...s }, !n.streetNumber) {
|
|
9
|
+
const e = parseInt(n.address.split(",")[1]), r = parseInt(n.zip);
|
|
10
|
+
e && e !== r && (n.streetNumber = e.toString());
|
|
11
|
+
}
|
|
12
|
+
return n;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
m as googlePlaceConverter
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n={maximumAge:6*60*1e3,timeout:10*1e3},o=()=>!!window.navigator.geolocation,r=(t=n)=>{if(o())return new Promise((e,i)=>{navigator.geolocation.getCurrentPosition(e,i,t)})};exports.browserSupportGeolocation=o;exports.getUserPosition=r;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
//maximum age in milliseconds of a possible cached position
|
|
3
|
+
maximumAge: 36e4,
|
|
4
|
+
//--> 1 hour
|
|
5
|
+
//maximum length of time (in milliseconds) the device is allowed to take in order to return a position
|
|
6
|
+
timeout: 1e4
|
|
7
|
+
//--> 10 sec
|
|
8
|
+
}, n = () => !!window.navigator.geolocation, r = (o = i) => {
|
|
9
|
+
if (n())
|
|
10
|
+
return new Promise(
|
|
11
|
+
(t, e) => {
|
|
12
|
+
navigator.geolocation.getCurrentPosition(t, e, o);
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
n as browserSupportGeolocation,
|
|
18
|
+
r as getUserPosition
|
|
19
|
+
};
|
package/dist/StringUtils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(e,t,n){return e.replace(new RegExp(t,"g"),n)}function i(e){return e.charAt(0).toUpperCase()+e.slice(1)}function l(e){if(!e)return"";const t=document.createElement("span");return t.innerHTML=e,t.textContent||""}function o(e,t){const n=new RegExp(Object.keys(t).map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|"),"gi");return e.replace(n,function(r){return t[r.toLowerCase()]})}function a(e){return e.replace(/[\uA78C\uA78B]/g,"'").replace(/[^\x00-\x7F]/g,"")}const u=(e="")=>!e||!e.trim()?"":(e=e.trim(),e.replace(" ","-").toLowerCase());exports.capitalizeFirstLetter=i;exports.cleanASCII=a;exports.decodeTextWithEntities=l;exports.replaceAll=c;exports.replaceAllTokens=o;exports.stringToHyphened=u;
|
package/dist/StringUtils.js
CHANGED
|
@@ -1,40 +1,33 @@
|
|
|
1
|
-
function
|
|
1
|
+
function c(e, n, r) {
|
|
2
2
|
return e.replace(new RegExp(n, "g"), r);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function o(e) {
|
|
5
5
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
6
6
|
}
|
|
7
|
-
function l(e, n, r, o) {
|
|
8
|
-
const t = [];
|
|
9
|
-
e && e !== "ND" && (n && n !== "ND" && n !== "0" ? t.push(`${e} ${n}`) : t.push(e)), r && o ? t.push(`${r} (${o})`) : t.push(r);
|
|
10
|
-
const c = t.filter((u) => !!u).join(", ");
|
|
11
|
-
return i(c);
|
|
12
|
-
}
|
|
13
7
|
function a(e) {
|
|
14
8
|
if (!e)
|
|
15
9
|
return "";
|
|
16
10
|
const n = document.createElement("span");
|
|
17
11
|
return n.innerHTML = e, n.textContent || "";
|
|
18
12
|
}
|
|
19
|
-
function
|
|
13
|
+
function u(e, n) {
|
|
20
14
|
const r = new RegExp(
|
|
21
|
-
Object.keys(n).map((
|
|
15
|
+
Object.keys(n).map((t) => t.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")).join("|"),
|
|
22
16
|
"gi"
|
|
23
17
|
);
|
|
24
|
-
return e.replace(r, function(
|
|
25
|
-
return n[
|
|
18
|
+
return e.replace(r, function(t) {
|
|
19
|
+
return n[t.toLowerCase()];
|
|
26
20
|
});
|
|
27
21
|
}
|
|
28
|
-
function
|
|
22
|
+
function i(e) {
|
|
29
23
|
return e.replace(/[\uA78C\uA78B]/g, "'").replace(/[^\x00-\x7F]/g, "");
|
|
30
24
|
}
|
|
31
|
-
const
|
|
25
|
+
const l = (e = "") => !e || !e.trim() ? "" : (e = e.trim(), e.replace(" ", "-").toLowerCase());
|
|
32
26
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
o as capitalizeFirstLetter,
|
|
28
|
+
i as cleanASCII,
|
|
35
29
|
a as decodeTextWithEntities,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
d as stringToHyphened
|
|
30
|
+
c as replaceAll,
|
|
31
|
+
u as replaceAllTokens,
|
|
32
|
+
l as stringToHyphened
|
|
40
33
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./ArrayUtils.cjs"),O=require("./ColorUtils.cjs"),i=require("./CookieUtils.cjs"),p=require("./CurrencyUtils.cjs"),C=require("./DateUtils.cjs"),o=require("./DeviceDetectionUtils.cjs"),s=require("./DOMUtils.cjs"),n=require("./EmailUtils.cjs"),E=require("./FunctionUtils.cjs"),c=require("./GenericUtils.cjs"),r=require("./NumberUtils.cjs"),a=require("./ObjectUtils.cjs"),R=require("./ObserverUtils.cjs"),m=require("./PermissionUtils.cjs"),l=require("./RESB_UrlBuilder.cjs"),t=require("./StringUtils.cjs"),g=require("./URLBuilderUtils.cjs"),e=require("./RegexUtils.cjs"),u=require("./GeolocationUtils.cjs"),d=require("./AdressUtils.cjs"),S=require("./GAutocompleteUtils.cjs");exports.isArrNullOrEmpty=b.isArrNullOrEmpty;exports.rgba=O.rgba;exports.decodeCookie=i.decodeCookie;exports.encodeCookie=i.encodeCookie;exports.getCookie=i.getCookie;exports.removeCookie=i.removeCookie;exports.formatCurrency=p.formatCurrency;exports.formatDate=C.formatDate;exports.getCurrentDeviceSize=o.getCurrentDeviceSize;exports.isMobile=o.isMobile;exports.isSafari=o.isSafari;exports.isiOSDevice=o.isiOSDevice;exports.emptyElem=s.emptyElem;exports.getSingleElement=s.getSingleElement;exports.hideElem=s.hideElem;exports.showElem=s.showElem;exports.hash256=n.hash256;exports.hashEmail=n.hashEmail;exports.debounce=E.debounce;exports.isPromise=E.isPromise;exports.awaitableSetTimeout=c.awaitableSetTimeout;exports.createCustomEvent=c.createCustomEvent;exports.formatFloat=r.formatFloat;exports.formatInteger=r.formatInteger;exports.formatLocaleNumber=r.formatLocaleNumber;exports.formatNumber=r.formatNumber;exports.formatterNumberObj=r.formatterNumberObj;exports.parseLocaleNumber=r.parseLocaleNumber;exports.deepCopy=a.deepCopy;exports.isEmptyObject=a.isEmptyObject;exports.shallowCopyObjectTo=a.shallowCopyObjectTo;exports.observeOnce=R.observeOnce;exports.addPermissionStateListener=m.addPermissionStateListener;exports.onNotificationsPermissionChange=m.onNotificationsPermissionChange;exports.buildParams=l.buildParams;exports.buildParamsForAgency=l.buildParamsForAgency;exports.buildURL=l.buildURL;exports.capitalizeFirstLetter=t.capitalizeFirstLetter;exports.cleanASCII=t.cleanASCII;exports.decodeTextWithEntities=t.decodeTextWithEntities;exports.replaceAll=t.replaceAll;exports.replaceAllTokens=t.replaceAllTokens;exports.stringToHyphened=t.stringToHyphened;exports.appendQueryString=g.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=u.browserSupportGeolocation;exports.getUserPosition=u.getUserPosition;exports.formatAddress=d.formatAddress;exports.formattedAddress=d.formattedAddress;exports.googlePlaceConverter=S.googlePlaceConverter;
|
package/dist/index.d.ts
CHANGED
|
@@ -16,3 +16,6 @@ export * from './utils/RESB_UrlBuilder';
|
|
|
16
16
|
export * from './utils/StringUtils';
|
|
17
17
|
export * from './utils/URLBuilderUtils';
|
|
18
18
|
export * from './utils/RegexUtils';
|
|
19
|
+
export * from './utils/GeolocationUtils';
|
|
20
|
+
export * from './utils/AdressUtils';
|
|
21
|
+
export * from './utils/GAutocompleteUtils';
|
package/dist/index.js
CHANGED
|
@@ -1,75 +1,82 @@
|
|
|
1
1
|
import { isArrNullOrEmpty as r } from "./ArrayUtils.js";
|
|
2
2
|
import { rgba as m } from "./ColorUtils.js";
|
|
3
|
-
import { decodeCookie as a, encodeCookie as E, getCookie as p, removeCookie as
|
|
3
|
+
import { decodeCookie as a, encodeCookie as E, getCookie as p, removeCookie as s } from "./CookieUtils.js";
|
|
4
4
|
import { formatCurrency as l } from "./CurrencyUtils.js";
|
|
5
|
-
import { formatDate as
|
|
6
|
-
import { getCurrentDeviceSize as d, isMobile as b, isSafari as
|
|
7
|
-
import { emptyElem as
|
|
8
|
-
import { hash256 as G, hashEmail as
|
|
9
|
-
import { debounce as
|
|
10
|
-
import { awaitableSetTimeout as
|
|
11
|
-
import { formatFloat as I, formatInteger as
|
|
12
|
-
import { deepCopy as H, isEmptyObject as
|
|
5
|
+
import { formatDate as x } from "./DateUtils.js";
|
|
6
|
+
import { getCurrentDeviceSize as d, isMobile as b, isSafari as u, isiOSDevice as O } from "./DeviceDetectionUtils.js";
|
|
7
|
+
import { emptyElem as R, getSingleElement as g, hideElem as S, showElem as _ } from "./DOMUtils.js";
|
|
8
|
+
import { hash256 as G, hashEmail as X } from "./EmailUtils.js";
|
|
9
|
+
import { debounce as T, isPromise as h } from "./FunctionUtils.js";
|
|
10
|
+
import { awaitableSetTimeout as y, createCustomEvent as N } from "./GenericUtils.js";
|
|
11
|
+
import { formatFloat as I, formatInteger as v, formatLocaleNumber as M, formatNumber as k, formatterNumberObj as w, parseLocaleNumber as j } from "./NumberUtils.js";
|
|
12
|
+
import { deepCopy as H, isEmptyObject as U, shallowCopyObjectTo as z } from "./ObjectUtils.js";
|
|
13
13
|
import { observeOnce as W } from "./ObserverUtils.js";
|
|
14
14
|
import { addPermissionStateListener as q, onNotificationsPermissionChange as J } from "./PermissionUtils.js";
|
|
15
15
|
import { buildParams as V, buildParamsForAgency as Y, buildURL as Z } from "./RESB_UrlBuilder.js";
|
|
16
|
-
import { capitalizeFirstLetter as ee, cleanASCII as oe, decodeTextWithEntities as re,
|
|
17
|
-
import { appendQueryString as
|
|
18
|
-
import { COMPETITOR_REGEX as se, DATE_REGEX as
|
|
16
|
+
import { capitalizeFirstLetter as ee, cleanASCII as oe, decodeTextWithEntities as re, replaceAll as te, replaceAllTokens as me, stringToHyphened as ie } from "./StringUtils.js";
|
|
17
|
+
import { appendQueryString as Ee } from "./URLBuilderUtils.js";
|
|
18
|
+
import { COMPETITOR_REGEX as se, DATE_REGEX as fe, EMAIL_REGEX as le, EMAIL_REGEX_INTO_TEXT as ne, EXCLUDED_REGEX as xe, GLOBAL_PHONE_REGEX as ce, PASSWORD_REGEX as de, PHONE_REGEX as be, ROOMS_REGEX as ue, SQM_REGEX as Oe } from "./RegexUtils.js";
|
|
19
|
+
import { browserSupportGeolocation as Re, getUserPosition as ge } from "./GeolocationUtils.js";
|
|
20
|
+
import { formatAddress as _e, formattedAddress as Ae } from "./AdressUtils.js";
|
|
21
|
+
import { googlePlaceConverter as Xe } from "./GAutocompleteUtils.js";
|
|
19
22
|
export {
|
|
20
23
|
se as COMPETITOR_REGEX,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
fe as DATE_REGEX,
|
|
25
|
+
le as EMAIL_REGEX,
|
|
26
|
+
ne as EMAIL_REGEX_INTO_TEXT,
|
|
24
27
|
xe as EXCLUDED_REGEX,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
ce as GLOBAL_PHONE_REGEX,
|
|
29
|
+
de as PASSWORD_REGEX,
|
|
30
|
+
be as PHONE_REGEX,
|
|
28
31
|
ue as ROOMS_REGEX,
|
|
29
|
-
|
|
32
|
+
Oe as SQM_REGEX,
|
|
30
33
|
q as addPermissionStateListener,
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
Ee as appendQueryString,
|
|
35
|
+
y as awaitableSetTimeout,
|
|
36
|
+
Re as browserSupportGeolocation,
|
|
33
37
|
V as buildParams,
|
|
34
38
|
Y as buildParamsForAgency,
|
|
35
39
|
Z as buildURL,
|
|
36
40
|
ee as capitalizeFirstLetter,
|
|
37
41
|
oe as cleanASCII,
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
N as createCustomEvent,
|
|
43
|
+
T as debounce,
|
|
40
44
|
a as decodeCookie,
|
|
41
45
|
re as decodeTextWithEntities,
|
|
42
46
|
H as deepCopy,
|
|
43
|
-
|
|
47
|
+
R as emptyElem,
|
|
44
48
|
E as encodeCookie,
|
|
45
|
-
|
|
49
|
+
_e as formatAddress,
|
|
46
50
|
l as formatCurrency,
|
|
47
|
-
|
|
51
|
+
x as formatDate,
|
|
48
52
|
I as formatFloat,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
v as formatInteger,
|
|
54
|
+
M as formatLocaleNumber,
|
|
55
|
+
k as formatNumber,
|
|
56
|
+
Ae as formattedAddress,
|
|
57
|
+
w as formatterNumberObj,
|
|
53
58
|
p as getCookie,
|
|
54
59
|
d as getCurrentDeviceSize,
|
|
55
|
-
|
|
60
|
+
g as getSingleElement,
|
|
61
|
+
ge as getUserPosition,
|
|
62
|
+
Xe as googlePlaceConverter,
|
|
56
63
|
G as hash256,
|
|
57
|
-
|
|
64
|
+
X as hashEmail,
|
|
58
65
|
S as hideElem,
|
|
59
66
|
r as isArrNullOrEmpty,
|
|
60
|
-
|
|
67
|
+
U as isEmptyObject,
|
|
61
68
|
b as isMobile,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
h as isPromise,
|
|
70
|
+
u as isSafari,
|
|
71
|
+
O as isiOSDevice,
|
|
65
72
|
W as observeOnce,
|
|
66
73
|
J as onNotificationsPermissionChange,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
j as parseLocaleNumber,
|
|
75
|
+
s as removeCookie,
|
|
76
|
+
te as replaceAll,
|
|
77
|
+
me as replaceAllTokens,
|
|
71
78
|
m as rgba,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
z as shallowCopyObjectTo,
|
|
80
|
+
_ as showElem,
|
|
81
|
+
ie as stringToHyphened
|
|
75
82
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats the address based on the provided street name, street number, city name, and province acronym.
|
|
3
|
+
*
|
|
4
|
+
* @param streetName The name of the street.
|
|
5
|
+
* @param streetNumber The number of the street.
|
|
6
|
+
* @param cityName The name of the city.
|
|
7
|
+
* @param provinceAcronym The acronym of the province (optional).
|
|
8
|
+
* @returns The formatted address with capitalized first letters of each component.
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatAddress(streetName: string, streetNumber: string, cityName: string, provinceAcronym?: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Formats the address based on the provided parameters.
|
|
13
|
+
* If streetName is provided, it calls the formatAddress function with streetName, streetNumber, and cityName.
|
|
14
|
+
* If streetName is not provided, it returns the addressName.
|
|
15
|
+
*
|
|
16
|
+
* @param addressName - The name of the address.
|
|
17
|
+
* @param streetName - The name of the street.
|
|
18
|
+
* @param streetNumber - The number of the street.
|
|
19
|
+
* @param cityName - The name of the city.
|
|
20
|
+
* @returns The formatted address string.
|
|
21
|
+
*/
|
|
22
|
+
export declare const formattedAddress: (addressName: string, streetName: string | undefined, streetNumber: string | undefined, cityName: string) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the browser supports geolocation.
|
|
3
|
+
* @returns A boolean indicating whether the browser supports geolocation.
|
|
4
|
+
*/
|
|
5
|
+
export declare const browserSupportGeolocation: () => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Gets the user's geolocation position.
|
|
8
|
+
* @param options - The options for getting the geolocation position. Defaults to { maximumAge: 6*60*1000, timeout: 10*1000 }.
|
|
9
|
+
* @returns A promise that resolves with the geolocation position.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getUserPosition: (options?: PositionOptions) => Promise<GeolocationPosition> | undefined;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export declare function replaceAll(str: string, find: string, replace: string): string;
|
|
2
|
+
/**
|
|
3
|
+
* Capitalizes the first letter of a given string.
|
|
4
|
+
*
|
|
5
|
+
* @param string The input string to capitalize the first letter.
|
|
6
|
+
* @returns The input string with the first letter capitalized.
|
|
7
|
+
*/
|
|
2
8
|
export declare function capitalizeFirstLetter(string: string): string;
|
|
3
|
-
export declare function formatAddress(streetName: string, streetNumber: string, cityName: string, provinceAcronym?: string): string;
|
|
4
9
|
export declare function decodeTextWithEntities(strWithEntities: string | null): string;
|
|
5
10
|
/**
|
|
6
11
|
* Replaces a given string with the values of the object
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wikicasa-dev/utilities",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Wikicasa frontend utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"typescript": "^5.4.3",
|
|
39
39
|
"vite": "^5.2.3",
|
|
40
40
|
"vite-plugin-dts": "^3.7.3",
|
|
41
|
-
"@wikicasa-dev/types": "^1.2.
|
|
41
|
+
"@wikicasa-dev/types": "^1.2.2"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"axios": "^1.4.0",
|