@defjs/core 0.0.0-test-0009 → 0.0.0-test-0011

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -16
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -285,9 +285,6 @@ async function fillRequestFromField(request, fieldOrFieldGroup, input) {
285
285
  }
286
286
  for (const [type, aliasName] of meta.alias) {
287
287
  switch (type) {
288
- case 1 /* Json */:
289
- body = JSON.stringify(fieldValue);
290
- break;
291
288
  case 2 /* Query */: {
292
289
  if (!aliasName) {
293
290
  throwAliaNotSet();
@@ -316,6 +313,7 @@ async function fillRequestFromField(request, fieldOrFieldGroup, input) {
316
313
  body = appendValue(new FormData, aliasName, fieldValue);
317
314
  break;
318
315
  }
316
+ case 1 /* Json */:
319
317
  case 6 /* Body */:
320
318
  body = fieldValue;
321
319
  break;
@@ -379,7 +377,7 @@ async function fillRequestFromField(request, fieldOrFieldGroup, input) {
379
377
  } else if (Array.from(formData.keys()).length > 0) {
380
378
  request.body = formData;
381
379
  } else if (Object.keys(json).length) {
382
- request.body = JSON.stringify(json);
380
+ request.body = json;
383
381
  }
384
382
  return;
385
383
  }
@@ -520,18 +518,18 @@ async function fetchHandler(httpRequest) {
520
518
  loaded: receivedLength,
521
519
  total: contentLength
522
520
  });
523
- const chunksAll = concatChunks(chunks, receivedLength);
524
- try {
525
- body = parseBody(httpRequest, response2, chunksAll);
526
- } catch (error) {
527
- throw makeResponse({
528
- error: error instanceof Error ? error : new Error("Parse response body error"),
529
- url,
530
- status,
531
- statusText,
532
- headers
533
- });
534
- }
521
+ }
522
+ const chunksAll = concatChunks(chunks, receivedLength);
523
+ try {
524
+ body = parseBody(httpRequest, response2, chunksAll);
525
+ } catch (error) {
526
+ throw makeResponse({
527
+ error: error instanceof Error ? error : new Error("Parse response body error"),
528
+ url,
529
+ status,
530
+ statusText,
531
+ headers
532
+ });
535
533
  }
536
534
  }
537
535
  return makeResponse({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defjs/core",
3
- "version": "0.0.0-test-0009",
3
+ "version": "0.0.0-test-0011",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "bun run ./scripts/build.ts",
@@ -18,8 +18,8 @@
18
18
  "exports": {
19
19
  "./package.json": "./package.json",
20
20
  ".": {
21
- "types": "./index.d.ts",
22
- "default": "./index.js"
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.js"
23
23
  }
24
24
  }
25
25
  }