
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
redux-form-numeric-field
Advanced tools
A customized redux-form
Field
for entering numbers. It isn't contrary; it won't stop you from typing, pasting, or cutting
any characters.
When it loses focus it will normalize its value to a number, if valid; otherwise it will trim its value but leave it as a string,
and produce a "must be a number" validation error.
npm install --save redux-form-numeric-field
const {NumericField} = require('redux-form-numeric-field')
or
const {NumericField} = require('redux-form-numeric-field/immutable')
The following field will trim its text when it loses focus:
<NumericField
name="name"
component={YourInputComponent}
/>
NumericField
Has the same API as redux-form
's Field
, but normalizes its value to a number when it loses focus
(unless the text is not a valid number, in which case it will just trim the text when it loses focus).
normalizeNumber?: (value: ?(string | number)) => ?(string | number)
Allows you to override the default implementation which is called on blur. If value
is a number
or
correctly-formatted string
, return a number
; otherwise, return a string
or null
.
normalizeOnBlur?: (value: ?(string | number)) => ?(string | number)
If you provide this, it will be called with the output of normalizeNumber
.
validate?: Validator | Array<Validator>
Unlike a normal Field
, NumericField
will call your validators with the normalized number from
normalizeNumber
. If its value is an invalid number but not whitespace, it will produce a
"must be a number" validation error without calling your own validators.
FAQs
a customized redux-form Field for entering numbers
The npm package redux-form-numeric-field receives a total of 197 weekly downloads. As such, redux-form-numeric-field popularity was classified as not popular.
We found that redux-form-numeric-field demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.