@k37z3r/jbase 2.0.2 → 2.0.3
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/CHANGELOG.md +9 -1
- package/dist/index.cjs +33 -10
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +33 -10
- package/dist/index.mjs.map +2 -2
- package/dist/jbase.browser.js +33 -10
- package/dist/jbase.browser.js.map +2 -2
- package/dist/jbase.min.js +2 -2
- package/dist/jbase.min.js.map +3 -3
- package/dist/modules/http/get.d.ts +7 -3
- package/dist/modules/http/get.d.ts.map +1 -1
- package/dist/modules/http/index.d.ts +3 -3
- package/dist/modules/http/post.d.ts +5 -3
- package/dist/modules/http/post.d.ts.map +1 -1
- package/dist/server.js +33 -10
- package/dist/server.js.map +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -39,4 +39,12 @@ All notable changes to this project will be documented in this file.
|
|
|
39
39
|
|
|
40
40
|
* **Documentation:** Removed localized German JSDoc comments to reduce source code size and maintain a consistent English-only documentation standard.
|
|
41
41
|
* **Config:** Fixed invalid JSON syntax in `tsconfig.json`.
|
|
42
|
-
* **Type Safety:** Upgraded `isObject` utility to a TypeScript Type Guard for better type inference.
|
|
42
|
+
* **Type Safety:** Upgraded `isObject` utility to a TypeScript Type Guard for better type inference.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## [2.0.3] - 2026-02-13
|
|
46
|
+
|
|
47
|
+
### 🛡️ Fixed (http)
|
|
48
|
+
|
|
49
|
+
* **HTTP Module (`http/get.ts`):** Enforce GET method in get() and getText() utility. Overrides method to 'GET' if 'POST' is passed in options.
|
|
50
|
+
* **HTTP Module (`http/post.ts`):** Enforce POST method in post() utility. Overrides method to 'POST' if 'GET' is passed in options.
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @k37z3r/jbase - A modern micro-framework for the web: jBase offers the familiar syntax of classic DOM libraries, but without their baggage. Fully typed, modular, and optimized for modern browser engines.
|
|
3
|
-
* @version 2.0.
|
|
3
|
+
* @version 2.0.3
|
|
4
4
|
* @homepage https://github.com/k37z3r/jBase-2.0
|
|
5
5
|
* @author Sven Minio (https://github.com/k37z3r/jBase-2.0)
|
|
6
6
|
* @license GPL-3.0-or-later
|
|
@@ -1278,9 +1278,16 @@ __export(get_exports, {
|
|
|
1278
1278
|
get: () => get,
|
|
1279
1279
|
getText: () => getText
|
|
1280
1280
|
});
|
|
1281
|
-
async function get(url) {
|
|
1281
|
+
async function get(url, option) {
|
|
1282
|
+
const fetchOptions = { ...option };
|
|
1283
|
+
if (fetchOptions.method?.toLowerCase() === "post") {
|
|
1284
|
+
fetchOptions.method = "GET";
|
|
1285
|
+
}
|
|
1286
|
+
if (!fetchOptions.signal) {
|
|
1287
|
+
fetchOptions.signal = AbortSignal.timeout(5e3);
|
|
1288
|
+
}
|
|
1282
1289
|
const response = await fetch(url, {
|
|
1283
|
-
|
|
1290
|
+
...fetchOptions
|
|
1284
1291
|
});
|
|
1285
1292
|
if (!response.ok) {
|
|
1286
1293
|
throw new Error(`HTTP Error: ${response.status}`);
|
|
@@ -1288,8 +1295,17 @@ async function get(url) {
|
|
|
1288
1295
|
const text2 = await response.text();
|
|
1289
1296
|
return text2 ? JSON.parse(text2) : {};
|
|
1290
1297
|
}
|
|
1291
|
-
async function getText(url) {
|
|
1292
|
-
const
|
|
1298
|
+
async function getText(url, option) {
|
|
1299
|
+
const fetchOptions = { ...option };
|
|
1300
|
+
if (fetchOptions.method?.toLowerCase() !== "get") {
|
|
1301
|
+
fetchOptions.method = "GET";
|
|
1302
|
+
}
|
|
1303
|
+
if (!fetchOptions.signal) {
|
|
1304
|
+
fetchOptions.signal = AbortSignal.timeout(5e3);
|
|
1305
|
+
}
|
|
1306
|
+
const response = await fetch(url, {
|
|
1307
|
+
...fetchOptions
|
|
1308
|
+
});
|
|
1293
1309
|
if (!response.ok) {
|
|
1294
1310
|
throw new Error(`HTTP Error: ${response.status}`);
|
|
1295
1311
|
}
|
|
@@ -1302,9 +1318,16 @@ var post_exports = {};
|
|
|
1302
1318
|
__export(post_exports, {
|
|
1303
1319
|
post: () => post
|
|
1304
1320
|
});
|
|
1305
|
-
async function post(url, body = {}) {
|
|
1321
|
+
async function post(url, body = {}, option) {
|
|
1322
|
+
const fetchOptions = { ...option };
|
|
1323
|
+
if (fetchOptions.method?.toLowerCase() !== "post") {
|
|
1324
|
+
fetchOptions.method = "post";
|
|
1325
|
+
}
|
|
1326
|
+
if (!fetchOptions.signal) {
|
|
1327
|
+
fetchOptions.signal = AbortSignal.timeout(5e3);
|
|
1328
|
+
}
|
|
1306
1329
|
const response = await fetch(url, {
|
|
1307
|
-
|
|
1330
|
+
...fetchOptions,
|
|
1308
1331
|
headers: { "Content-Type": "application/json" },
|
|
1309
1332
|
body: JSON.stringify(body)
|
|
1310
1333
|
});
|
|
@@ -2140,7 +2163,7 @@ var __ = init;
|
|
|
2140
2163
|
*/
|
|
2141
2164
|
/**
|
|
2142
2165
|
* @file src/modules/http/get.ts
|
|
2143
|
-
* @version 2.0.
|
|
2166
|
+
* @version 2.0.3
|
|
2144
2167
|
* @since 2.0.0
|
|
2145
2168
|
* @license GPL-3.0-or-later
|
|
2146
2169
|
* @copyright Sven Minio 2026
|
|
@@ -2153,8 +2176,8 @@ var __ = init;
|
|
|
2153
2176
|
*/
|
|
2154
2177
|
/**
|
|
2155
2178
|
* @file src/modules/http/post.ts
|
|
2156
|
-
* @version 2.0.
|
|
2157
|
-
* @since 2.0.
|
|
2179
|
+
* @version 2.0.3
|
|
2180
|
+
* @since 2.0.2
|
|
2158
2181
|
* @license GPL-3.0-or-later
|
|
2159
2182
|
* @copyright Sven Minio 2026
|
|
2160
2183
|
* @author Sven Minio <https://sven-minio.de>
|