Skip to content
A collection of error formatters used by Indicative
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
.github
docs
src
test
.editorconfig
.gitignore
.npmrc
CONTRIBUTING.md
LICENSE.md
README.md
config.json
index.ts
japaFile.js
package.json
tsconfig.json
tslint.json
typedoc.js

README.md


Indicative Formatters

Collection of error formatters used by Indicative

circleci-image npm-image

Indicative has first class support for formatting error messages with the help of an Error formatter. This repo contains a handful of them.

Table of contents

Usage

Install the package from npm registry as follows:

npm i indicative-formatters

# yarn
yarn add indicative-formatters

and then use it as follows:

import { VanillaFormatter } from 'indicative-formatters'

const formatter = new VanillaFormatter()
formatter.addError('Required validation failed', 'username', { name: 'required', args: [] })

// Get all errors
formatter.toJSON()

API Docs

Following are the autogenerated files via Typedoc

Maintainers

Harminder virk

You can’t perform that action at this time.