@adviser/cement 0.2.32 → 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 CHANGED
@@ -1325,15 +1325,17 @@ var BuildURI = class _BuildURI {
1325
1325
  // return this;
1326
1326
  // }
1327
1327
  appendRelative(p) {
1328
- const url = URI.from(p);
1329
- let pathname = url.pathname;
1330
- if (url.pathname === "/") {
1331
- pathname = "";
1332
- } else if (!pathname.startsWith("/")) {
1333
- pathname = `/${pathname}`;
1334
- }
1335
- this.pathname(this._url.pathname + pathname);
1336
- for (const [key, value] of url.getParams) {
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
  }
@@ -1459,6 +1464,9 @@ var URI = class _URI {
1459
1464
  getParamResult(key, msgFn) {
1460
1465
  return getParamResult(key, this.getParam(key), msgFn);
1461
1466
  }
1467
+ getParamsResult(...keys) {
1468
+ return getParamsResult(keys, this);
1469
+ }
1462
1470
  clone() {
1463
1471
  return new _URI(this._url);
1464
1472
  }