Skip to content

Commit

Permalink
fixed issue with callback is empty in case of file input
Browse files Browse the repository at this point in the history
  • Loading branch information
brainfoolong committed Feb 9, 2022
1 parent a937648 commit 948e88c
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 14 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
### 2.1.2 - 2022-02-09
### 2.1.2 and 2.1.3 - 2022-02-09

* fixed issue with skipEmpty and nested input value #25
* fixed issue with callback is empty in case of file input

### 2.1.1 - 06.December 2021

* accept a `$` instance also as html element in `toJson/fromJson`, which is used by many libraries that memic jquery
behaviour - previously only explicitly `jQuery` was supported


* ### 2.1.0 - 24.October 2021
### 2.1.0 - 24.October 2021

* added new toJson option `arrayify` to explicitely disable array return values when needed, default is `true`

Expand Down
12 changes: 9 additions & 3 deletions dist/form-data-json.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
// form-data-json-convert | version: 2.1.2 | url: https://github.com/brainfoolong/form-data-json
// form-data-json-convert | version: 2.1.3 | url: https://github.com/brainfoolong/form-data-json

/**
* Form Data Json Converter
Expand Down Expand Up @@ -248,7 +248,7 @@ var FormDataJson = /*#__PURE__*/function () {
recursion(tree, returnObject);

if (files.length) {
(function () {
var _ret = function () {
var filesDone = 0;
var filesRequired = 0;

Expand Down Expand Up @@ -290,7 +290,13 @@ var FormDataJson = /*#__PURE__*/function () {
for (var i = 0; i < files.length; i++) {
_loop(i);
}
})();

return {
v: null
};
}();

if (typeof _ret === "object") return _ret.v;
} else if (options.filesCallback) {
options.filesCallback(output());
return null;
Expand Down
4 changes: 2 additions & 2 deletions dist/form-data-json.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions docs/scripts/form-data-json.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
// form-data-json-convert | version: 2.1.2 | url: https://github.com/brainfoolong/form-data-json
// form-data-json-convert | version: 2.1.3 | url: https://github.com/brainfoolong/form-data-json

/**
* Form Data Json Converter
Expand Down Expand Up @@ -248,7 +248,7 @@ var FormDataJson = /*#__PURE__*/function () {
recursion(tree, returnObject);

if (files.length) {
(function () {
var _ret = function () {
var filesDone = 0;
var filesRequired = 0;

Expand Down Expand Up @@ -290,7 +290,13 @@ var FormDataJson = /*#__PURE__*/function () {
for (var i = 0; i < files.length; i++) {
_loop(i);
}
})();

return {
v: null
};
}();

if (typeof _ret === "object") return _ret.v;
} else if (options.filesCallback) {
options.filesCallback(output());
return null;
Expand Down
Loading

0 comments on commit 948e88c

Please sign in to comment.