@webqit/webflo 0.11.53-0 → 0.11.54

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/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "vanila-javascript"
13
13
  ],
14
14
  "homepage": "https://webqit.io/tooling/webflo",
15
- "version": "0.11.53-0",
15
+ "version": "0.11.54",
16
16
  "license": "MIT",
17
17
  "repository": {
18
18
  "type": "git",
@@ -59,7 +59,7 @@ export async function jsonfyFormData(formData, jsonfy = true) {
59
59
  for (let [ name, value ] of formData.entries()) {
60
60
  if (!json) { json = _isNumeric(_before(name, '[')) ? [] : {}; }
61
61
  let type = dataType(value);
62
- if (jsonfy && type === 'Blob' && value.type === 'application/json' && [4, 5].includes(value.size)) {
62
+ if (jsonfy && ['Blob', 'File'].includes(type) && value.type === 'application/json' && [4, 5].includes(value.size)) {
63
63
  let _value = await value.text();
64
64
  if (['true', 'false', 'null'].includes(_value)) {
65
65
  type = 'json';
@@ -9,8 +9,8 @@ import { jsonfyFormData } from './util-http.js';
9
9
  */
10
10
  export default class xFormData extends FormData {
11
11
 
12
- json(data = {}) {
13
- const result = jsonfyFormData(this, ...arguments);
12
+ async json(data = {}) {
13
+ const result = await jsonfyFormData(this, ...arguments);
14
14
  return result[0];
15
15
  }
16
16
 
@@ -12,7 +12,6 @@ import { formatMessage } from './util-http.js';
12
12
  export default class xRequest extends mxHttpMessage(Request, xRequestHeaders) {
13
13
 
14
14
  constructor(input, init = {}, meta = {}) {
15
- console.log('--------------------');
16
15
  if (!(init instanceof Request) && 'body' in init) {
17
16
  const [ body, headers, type ] = formatMessage(init);
18
17
  meta = { ...meta, type, body: init.body };
@@ -77,7 +77,7 @@ const xxHttpMessage = (whatwagHttpMessage, xHeaders) => {
77
77
  try {
78
78
  if (contentType === 'application/x-www-form-urlencoded' || contentType.startsWith('multipart/form-data')) {
79
79
  const formData = await this.formData();
80
- jsonfied = formData?.json();
80
+ jsonfied = await formData?.json();
81
81
  } else if (contentType === 'application/json') {
82
82
  jsonfied = await this.json();
83
83
  } else if (contentType === 'text/plain') {