react-bsonschema-form
Advanced tools
Comparing version 0.43.2 to 0.43.3
@@ -39,5 +39,6 @@ "use strict"; | ||
var options = other.uiSchema['ui:options']; | ||
// NOTE: formData is string, so when it's false, it must be empty string or undefined | ||
var parse = function parse(value) { | ||
return typeof value === 'string' ? stringToBsonNumber(value) : value; | ||
return typeof value === 'string' ? stringToBsonNumber(value, options) : value; | ||
}; | ||
@@ -44,0 +45,0 @@ return _react2.default.createElement(_StringField2.default, _extends({ |
@@ -19,3 +19,6 @@ 'use strict'; | ||
function stringToBsonNumber(string) { | ||
function stringToBsonNumber(string, _ref) { | ||
var _ref$decimalPlaces = _ref.decimalPlaces, | ||
decimalPlaces = _ref$decimalPlaces === undefined ? 2 : _ref$decimalPlaces; | ||
var float = parseFloat(string); | ||
@@ -25,3 +28,3 @@ if (isNaN(float)) { | ||
} else { | ||
return new _bson.Double(parseFloat(float.toFixed(2))); | ||
return new _bson.Double(parseFloat(float.toFixed(decimalPlaces))); | ||
} | ||
@@ -28,0 +31,0 @@ } |
{ | ||
"name": "react-bsonschema-form", | ||
"version": "0.43.2", | ||
"version": "0.43.3", | ||
"description": "A simple React component capable of building HTML forms out of a JSON schema.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3887704
5148