@adviser/cement 0.2.33 → 0.2.34
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/index.cjs +14 -9
- package/index.cjs.map +1 -1
- package/index.d.cts +1 -0
- package/index.d.ts +1 -0
- package/index.js +19 -14
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/jsr.json +1 -1
- package/src/uri.ts +25 -8
- package/ts/uri.d.ts +1 -0
- package/ts/uri.d.ts.map +1 -1
- package/ts/uri.js +12 -8
- package/ts/uri.js.map +1 -1
- package/ts/uri.test.js +35 -0
- package/ts/uri.test.js.map +1 -1
package/index.cjs
CHANGED
|
@@ -1325,15 +1325,17 @@ var BuildURI = class _BuildURI {
|
|
|
1325
1325
|
// return this;
|
|
1326
1326
|
// }
|
|
1327
1327
|
appendRelative(p) {
|
|
1328
|
-
const
|
|
1329
|
-
let pathname =
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1328
|
+
const appendUrl = URI.from(p);
|
|
1329
|
+
let pathname = appendUrl.pathname;
|
|
1330
|
+
let basePath = this._url.pathname;
|
|
1331
|
+
if (pathname.startsWith("/")) {
|
|
1332
|
+
pathname = pathname.replace(/^\//, "");
|
|
1333
|
+
}
|
|
1334
|
+
if (basePath.length > 0) {
|
|
1335
|
+
basePath = basePath.replace(/\/$/, "");
|
|
1336
|
+
}
|
|
1337
|
+
this.pathname(basePath + "/" + pathname);
|
|
1338
|
+
for (const [key, value] of appendUrl.getParams) {
|
|
1337
1339
|
this.setParam(key, value);
|
|
1338
1340
|
}
|
|
1339
1341
|
return this;
|
|
@@ -1371,6 +1373,9 @@ var BuildURI = class _BuildURI {
|
|
|
1371
1373
|
toJSON() {
|
|
1372
1374
|
return this.toString();
|
|
1373
1375
|
}
|
|
1376
|
+
asURL() {
|
|
1377
|
+
return this.URI().asURL();
|
|
1378
|
+
}
|
|
1374
1379
|
asObj(...strips) {
|
|
1375
1380
|
return this.URI().asObj(...strips);
|
|
1376
1381
|
}
|