@reidelsaltres/pureper 0.1.92 → 0.1.93
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/out/index.d.ts.map +1 -1
- package/out/index.js +5 -25
- package/out/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +5 -30
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE3D,cAAc,2CAA2C,CAAC;AAE1D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAG,MAAM,EAAC,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAEhF,cAAc,uBAAuB,CAAC;AAGtC,eAAO,MAAM,OAAO,EAAE,MAEjB,CAAC;AAEN,eAAO,MAAM,cAAc,EAAE,MAAyC,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
const computeHostingPath = () => {
|
|
2
|
-
if (typeof window === "undefined" || typeof window.location === "undefined") {
|
|
3
|
-
return "/";
|
|
4
|
-
}
|
|
5
|
-
const pathname = window.location.pathname || "/";
|
|
6
|
-
if (pathname === "") {
|
|
7
|
-
return "/";
|
|
8
|
-
}
|
|
9
|
-
if (pathname.endsWith("/")) {
|
|
10
|
-
return pathname;
|
|
11
|
-
}
|
|
12
|
-
const lastSlash = pathname.lastIndexOf("/");
|
|
13
|
-
if (lastSlash <= 0) {
|
|
14
|
-
// either no slash at all or only the leading slash
|
|
15
|
-
return pathname.includes(".") ? "/" : `${pathname}/`;
|
|
16
|
-
}
|
|
17
|
-
const lastSegment = pathname.slice(lastSlash + 1);
|
|
18
|
-
if (lastSegment && !lastSegment.includes(".")) {
|
|
19
|
-
// we are on a nested route without trailing slash — treat it as a directory
|
|
20
|
-
return `${pathname}/`;
|
|
21
|
-
}
|
|
22
|
-
return pathname.slice(0, lastSlash + 1);
|
|
23
|
-
};
|
|
24
1
|
export { default as Lazy } from './foundation/api/Lazy.js';
|
|
25
2
|
export * from './foundation/component_api/mixin/Proto.js';
|
|
26
3
|
export { default as UniHtml } from './foundation/component_api/UniHtml.js';
|
|
@@ -32,6 +9,9 @@ export { default as Fetcher } from './foundation/Fetcher.js';
|
|
|
32
9
|
export { Router } from './foundation/worker/Router.js';
|
|
33
10
|
export { default as ServiceWorker } from './foundation/worker/ServiceWorker.js';
|
|
34
11
|
export * from './foundation/Theme.js';
|
|
35
|
-
|
|
36
|
-
export const
|
|
12
|
+
// derive the part of href after the origin (e.g. "/path?query#hash")
|
|
13
|
+
export const HOSTING = window.location.href.startsWith(window.location.origin)
|
|
14
|
+
? window.location.href.substring(window.location.origin.length)
|
|
15
|
+
: "";
|
|
16
|
+
export const HOSTING_ORIGIN = window.location.origin + HOSTING;
|
|
37
17
|
//# sourceMappingURL=index.js.map
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE3D,cAAc,2CAA2C,CAAC;AAE1D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAG,MAAM,EAAC,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAEhF,cAAc,uBAAuB,CAAC;AAEtC,qEAAqE;AACrE,MAAM,CAAC,MAAM,OAAO,GAAW,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IACrF,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IAC/D,CAAC,CAAC,EAAE,CAAC;AAEN,MAAM,CAAC,MAAM,cAAc,GAAW,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,OAAO,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
const computeHostingPath = (): string => {
|
|
2
|
-
if (typeof window === "undefined" || typeof window.location === "undefined") {
|
|
3
|
-
return "/";
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
const pathname = window.location.pathname || "/";
|
|
7
|
-
if (pathname === "") {
|
|
8
|
-
return "/";
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (pathname.endsWith("/")) {
|
|
12
|
-
return pathname;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const lastSlash = pathname.lastIndexOf("/");
|
|
16
|
-
if (lastSlash <= 0) {
|
|
17
|
-
// either no slash at all or only the leading slash
|
|
18
|
-
return pathname.includes(".") ? "/" : `${pathname}/`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const lastSegment = pathname.slice(lastSlash + 1);
|
|
22
|
-
if (lastSegment && !lastSegment.includes(".")) {
|
|
23
|
-
// we are on a nested route without trailing slash — treat it as a directory
|
|
24
|
-
return `${pathname}/`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return pathname.slice(0, lastSlash + 1);
|
|
28
|
-
};
|
|
29
1
|
// Public package entry — re-export foundation APIs
|
|
30
2
|
export { default as IElementHolder } from './foundation/api/ElementHolder.js';
|
|
31
3
|
export { default as EmptyConstructor } from './foundation/api/EmptyConstructor.js';
|
|
@@ -47,6 +19,9 @@ export { default as ServiceWorker } from './foundation/worker/ServiceWorker.js';
|
|
|
47
19
|
|
|
48
20
|
export * from './foundation/Theme.js';
|
|
49
21
|
|
|
50
|
-
|
|
22
|
+
// derive the part of href after the origin (e.g. "/path?query#hash")
|
|
23
|
+
export const HOSTING: string = window.location.href.startsWith(window.location.origin)
|
|
24
|
+
? window.location.href.substring(window.location.origin.length)
|
|
25
|
+
: "";
|
|
51
26
|
|
|
52
|
-
export const HOSTING_ORIGIN: string =
|
|
27
|
+
export const HOSTING_ORIGIN: string = window.location.origin + HOSTING;
|