New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@reduct/nitpick

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reduct/nitpick

Type validators for the @reduct/component package.

latest
Source
npmnpm
Version
3.1.0
Version published
Maintainers
1
Created
Source

@reduct/nitpick

Build Status Dependency Status devDependency Status Code Climate Test Coverage

Type validators for the @reduct/component package.

Validators

The validators will, as the name states, validate as well as optionally transform the values into the requested types.

F.e. if you expect a Numberand the user passes in a String containing a Number, the validator will transform the value into a number. If the validation/transformation fails, the validator returns an Error object with a detailed message you can then throw.

propTypes.any.isRequired

Will expect that the passed value is not undefined or null, and returns an Error if the validation has failed.

propTypes.any.isOptional

Will expect that the passed value is not undefined or null, and always returns an object containing result and value key/value pairs.

propTypes.string.isRequired

Inherits the behavior of propTypes.any.isRequired, but it expects that the value is a String.

propTypes.string.isOptional

Inherits the behavior of propTypes.any.isOptional, but it expects that the value is a String.

propTypes.bool.isRequired

Inherits the behavior of propTypes.any.isRequired, but it expects that the value is either a Boolean or a String which can be converted to a Boolean.

propTypes.bool.isOptional

Inherits the behavior of propTypes.any.isOptional, but it expects that the value is either a Boolean or a String which can be converted to a Boolean.

propTypes.number.isRequired

Inherits the behavior of propTypes.any.isRequired, but it expects that the value is either a Number or a String containing a Number.

propTypes.number.isOptional

Inherits the behavior of propTypes.any.isOptional, but it expects that the value is either a Number or a String containing a Number.

propTypes.object.isRequired

Inherits the behavior of propTypes.any.isRequired, but it expects that the value is either a valid Object or a String containing a JSON Object.

propTypes.object.isOptional

Inherits the behavior of propTypes.any.isOptional, but it expects that the value is either a valid Object or a String containing a JSON Object.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style.

License

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

nitpick

FAQs

Package last updated on 16 Feb 2016

Did you know?

Socket

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.

Install

Related posts