Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-bsonschema-form

Package Overview
Dependencies
Maintainers
3
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-bsonschema-form - npm Package Compare versions

Comparing version 0.43.2 to 0.43.3

3

lib/components/fields/BsonNumberFieldHOC.js

@@ -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": {

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