@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 +17 -9
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -0
- package/index.d.ts +2 -0
- package/index.js +17 -9
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/jsr.json +1 -1
- package/src/uri.ts +29 -8
- package/ts/uri.d.ts +2 -0
- package/ts/uri.d.ts.map +1 -1
- package/ts/uri.js +15 -8
- package/ts/uri.js.map +1 -1
- package/ts/uri.test.js +43 -1
- 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
|
}
|
|
@@ -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
|
}
|