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

@codibly/api-validation

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codibly/api-validation

[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](ht

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
4
Weekly downloads
 
Created
Source

@codibly/api-validation

semantic-release code style: prettier commitizen friendly tested with jest

npm version npm license npm downloads npm types

Installation

This package is available as an npm package.

npm install --save @codibly/api-validation

or

yarn add @codibly/api-validation

Usage

The main gola of this library is to help is easy way handle api validation. ####Error Code

  • VALIDATION_ERROR - validation form error code ####Check error code To check if error has valid error code we use function isError
function isError(ErrorCode, Response | undefined): error is Error {}

####Get form errors To get validation form errors we have to functions which reducer array of errors to simple object where key is a filed name and value is a string or object.

- ValidationErrorMapper.toFormError(error: Error): FormError
- ValidationErrorMapper.toFormErrorsWithSheetCells(error: Error, sheetField: string[]): FormError

License

MIT

FAQs

Package last updated on 22 Nov 2019

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

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