@validarium/intl

0.7.2 • Public • Published

Intl

Validarium

by Lundegaard

🖍️ 🛡 🚀

Validations done right.

Platform-agnostic validation library for JavaScript applications with extra focus on composable validations and message translations. Includes (pretty much) out-of-the-box support for both Redux Form and React Intl.

Create your validation schema based on priciples of functional programming.

Open Validarium in a RunKit sandbox!

See our documentation site.

Github MIT License Travis Downloads Version

This package provides translator for react-inl messages. Also convenient API for validations. ## API reference

intl

This package provides translator for react-inl messages. Also convenient API for validations.


intl.validateTranslated ⇒ Object

Composed validate with translate. Gives you translated result directly. Params are curried

Returns: Object - Translated result.
Sig: Object -> Object -> Object -> Object

Param Type
intl Object
scheme Object
values Object

intl.validateTranslated(intl, ...fns, values) ⇒ Object

combine combineValidate with translate result.

Returns: Object - Translated result.
Sig: (Object, ...Functions) -> Object -> Object

Param Type Description
intl Object
...fns function Validation functions.
values Object

intl.translateResult(intl, result) ⇒ Object

Translate result of validations with react-intl. We assume that intl object is from react-intl (usually obtained by injectIntl).

Returns: Object - Translated result.

Param Type Description
intl Object
result Object to translate

Related projects

  • @redux-tools – Maintaining large Redux applications with ease.
  • react-union – Integrate React apps into various CMSs seamlessly.
  • lundium – Beautiful React component library.

License

All packages are distributed under the MIT license. See the license here.

Package Sidebar

Install

npm i @validarium/intl

Weekly Downloads

0

Version

0.7.2

License

MIT

Unpacked Size

62.7 kB

Total Files

15

Last publish

Collaborators

  • zstanek
  • tommmyy
  • xzayda
  • kohout.jakub