New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@availity/native-form

Package Overview
Dependencies
Maintainers
14
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@availity/native-form - npm Package Compare versions

Comparing version 2.8.6 to 2.8.7

tests/flattenObject.test.js

13

CHANGELOG.md

@@ -6,2 +6,15 @@ # Change Log

## [2.8.7](https://github.com/Availity/sdk-js/compare/@availity/native-form@2.8.6...@availity/native-form@2.8.7) (2020-01-14)
### Bug Fixes
* **native-form:** fixed error trying to call toString on undefined ([c009460](https://github.com/Availity/sdk-js/commit/c009460))
* **native-form:** updated handling of falsey values ([ab57615](https://github.com/Availity/sdk-js/commit/ab57615))
* **native-form:** updated test suite name ([fbf824c](https://github.com/Availity/sdk-js/commit/fbf824c))
## [2.8.6](https://github.com/Availity/sdk-js/compare/@availity/native-form@2.8.5...@availity/native-form@2.8.6) (2020-01-03)

@@ -8,0 +21,0 @@

9

lib/flattenObject.js

@@ -8,2 +8,7 @@ "use strict";

// Copied from https://github.com/Availity/sdk-js/blob/master/packages/native-form/flattenObject.js
const parseValue = value => {
return value === undefined || value === null ? value : value.toString();
};
const flattenObject = ob => Object.keys(ob).reduce((toReturn, k) => {

@@ -16,6 +21,6 @@ if (Object.prototype.toString.call(ob[k]) === '[object Date]') {

Object.keys(flatObject).forEach(k2 => {
toReturn[`${k}${isArray ? k2.replace(/^(\d+)(\..*)?/, '[$1]$2') : `.${k2}`}`] = flatObject[k2].toString();
toReturn[`${k}${isArray ? k2.replace(/^(\d+)(\..*)?/, '[$1]$2') : `.${k2}`}`] = parseValue(flatObject[k2]);
});
} else {
toReturn[k] = ob[k].toString();
toReturn[k] = parseValue(ob[k]);
}

@@ -22,0 +27,0 @@

{
"name": "@availity/native-form",
"version": "2.8.6",
"version": "2.8.7",
"description": "Submit JSON data via a native form, not AJAX. Useful when you need to open a new page with a POST action.",

@@ -22,3 +22,3 @@ "main": "lib/index.js",

},
"gitHead": "58e503379e5371c8552cb0c9747c10945b7b20a4"
"gitHead": "8622ddc58ced5e0651354cb1f64ce852f657d5f6"
}

@@ -0,1 +1,6 @@

// Copied from https://github.com/Availity/sdk-js/blob/master/packages/native-form/flattenObject.js
const parseValue = value => {
return value === undefined || value === null ? value : value.toString();
};
const flattenObject = ob =>

@@ -8,9 +13,10 @@ Object.keys(ob).reduce((toReturn, k) => {

const isArray = Array.isArray(ob[k]);
Object.keys(flatObject).forEach(k2 => {
toReturn[
`${k}${isArray ? k2.replace(/^(\d+)(\..*)?/, '[$1]$2') : `.${k2}`}`
] = flatObject[k2].toString();
] = parseValue(flatObject[k2]);
});
} else {
toReturn[k] = ob[k].toString();
toReturn[k] = parseValue(ob[k]);
}

@@ -17,0 +23,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc