Skip to content

Commit

Permalink
updates for upcoming stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
brainfoolong committed Sep 30, 2021
1 parent 70dfca6 commit 275935b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ You can edit this defaults globally by modifying `FormDataJson.defaultOptionsToJ
'uncheckedValue': undefined,

/**
* A function, where first parameter is the input field to check for, that must return true if the field should be included
* A function, where first parameter is the input field to check for
* Must return true if the field should be included
* All other return values, as well as no return value, will skip the input field in the progress
* @type {function|null}
*/
Expand All @@ -116,16 +117,19 @@ You can edit this defaults globally by modifying `FormDataJson.defaultOptionsToJ

/**
* If true, than this does skip empty fields from the output
* Empty is considered to be: an empty array (for multiple selects/checkboxes) and an empty input field (length = 0)
* Empty is considered to be:
* An empty array (for multiple selects/checkboxes)
* An empty input field (length = 0)
* This does recursively remove keys
* Example: {"agb":"1", "user" : [{"name" : ""},{"name" : ""}]} will be {"agb":"1"}
* @type {boolean}
*/
'skipEmpty': false,

/**
* A function the will be called when all file fields are read as base64 data uri
* Note: If this is given, than the original return value from toJson() is null and the values are passed to this callback as first parameter
* A function that will be called when all file fields are read as base64 data uri
* First passed parameter to this function are the form values including all file data
* Note: If set, the original return value from toJson() returns null
* @type {function|null}
*/
'filesCallback': null,
Expand Down
12 changes: 8 additions & 4 deletions dist/form-data-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ FormDataJson.defaultOptionsToJson = {
'uncheckedValue': undefined,

/**
* A function, where first parameter is the input field to check for, that must return true if the field should be included
* A function, where first parameter is the input field to check for
* Must return true if the field should be included
* All other return values, as well as no return value, will skip the input field in the progress
* @type {function|null}
*/
Expand All @@ -773,16 +774,19 @@ FormDataJson.defaultOptionsToJson = {

/**
* If true, than this does skip empty fields from the output
* Empty is considered to be: an empty array (for multiple selects/checkboxes) and an empty input field (length = 0)
* Empty is considered to be:
* An empty array (for multiple selects/checkboxes)
* An empty input field (length = 0)
* This does recursively remove keys
* Example: {"agb":"1", "user" : [{"name" : ""},{"name" : ""}]} will be {"agb":"1"}
* @type {boolean}
*/
'skipEmpty': false,

/**
* A function the will be called when all file fields are read as base64 data uri
* Note: If this is given, than the original return value from toJson() is null and the values are passed to this callback as first parameter
* A function that will be called when all file fields are read as base64 data uri
* First passed parameter to this function are the form values including all file data
* Note: If set, the original return value from toJson() returns null
* @type {function|null}
*/
'filesCallback': null,
Expand Down
12 changes: 8 additions & 4 deletions docs/scripts/form-data-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ FormDataJson.defaultOptionsToJson = {
'uncheckedValue': undefined,

/**
* A function, where first parameter is the input field to check for, that must return true if the field should be included
* A function, where first parameter is the input field to check for
* Must return true if the field should be included
* All other return values, as well as no return value, will skip the input field in the progress
* @type {function|null}
*/
Expand All @@ -773,16 +774,19 @@ FormDataJson.defaultOptionsToJson = {

/**
* If true, than this does skip empty fields from the output
* Empty is considered to be: an empty array (for multiple selects/checkboxes) and an empty input field (length = 0)
* Empty is considered to be:
* An empty array (for multiple selects/checkboxes)
* An empty input field (length = 0)
* This does recursively remove keys
* Example: {"agb":"1", "user" : [{"name" : ""},{"name" : ""}]} will be {"agb":"1"}
* @type {boolean}
*/
'skipEmpty': false,

/**
* A function the will be called when all file fields are read as base64 data uri
* Note: If this is given, than the original return value from toJson() is null and the values are passed to this callback as first parameter
* A function that will be called when all file fields are read as base64 data uri
* First passed parameter to this function are the form values including all file data
* Note: If set, the original return value from toJson() returns null
* @type {function|null}
*/
'filesCallback': null,
Expand Down
12 changes: 8 additions & 4 deletions src/form-data-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class FormDataJson {
'uncheckedValue': undefined,

/**
* A function, where first parameter is the input field to check for, that must return true if the field should be included
* A function, where first parameter is the input field to check for
* Must return true if the field should be included
* All other return values, as well as no return value, will skip the input field in the progress
* @type {function|null}
*/
Expand All @@ -48,16 +49,19 @@ class FormDataJson {

/**
* If true, than this does skip empty fields from the output
* Empty is considered to be: an empty array (for multiple selects/checkboxes) and an empty input field (length = 0)
* Empty is considered to be:
* An empty array (for multiple selects/checkboxes)
* An empty input field (length = 0)
* This does recursively remove keys
* Example: {"agb":"1", "user" : [{"name" : ""},{"name" : ""}]} will be {"agb":"1"}
* @type {boolean}
*/
'skipEmpty': false,

/**
* A function the will be called when all file fields are read as base64 data uri
* Note: If this is given, than the original return value from toJson() is null and the values are passed to this callback as first parameter
* A function that will be called when all file fields are read as base64 data uri
* First passed parameter to this function are the form values including all file data
* Note: If set, the original return value from toJson() returns null
* @type {function|null}
*/
'filesCallback': null,
Expand Down

0 comments on commit 275935b

Please sign in to comment.