# validate-firepad-text-operation

> Validate firepad text-operation

Latest version **1.1.1** (published 2017-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install validate-firepad-text-operation
pnpm add validate-firepad-text-operation
yarn add validate-firepad-text-operation
bun add validate-firepad-text-operation
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2017-01-11 |
| First published | 2016-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tejesh Mehta |
| Maintainers | tjmehta |
| Keywords | validate, firebase, text, operation, operation, ot, firepad, json, array |

## Links

- npm: https://www.npmjs.com/package/validate-firepad-text-operation
- Repository: https://github.com/tjmehta/validate-firepad-text-operation
- Homepage: https://github.com/tjmehta/validate-firepad-text-operation#readme
- Issues: https://github.com/tjmehta/validate-firepad-text-operation/issues
- npm.io page: https://npm.io/package/validate-firepad-text-operation

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [assert-err](https://npm.io/package/assert-err.md) ^1.1.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.1 (latest) — 2017-01-11
- 1.1.0 — 2016-11-05
- 1.0.3 — 2016-10-17
- 1.0.2 — 2016-09-28
- 1.0.1 — 2016-09-15
- 1.0.0 — 2016-09-13

## README

# validate-firepad-text-operation [![Build Status](https://travis-ci.org/tjmehta/validate-firepad-text-operation.svg)](https://travis-ci.org/tjmehta/validate-firepad-text-operation) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
Validate firepad text operation json

# Installation
```bash
npm i --save validate-firepad-text-operation
```

# Usage
Example 1: Successfully validate text-operation json
```js
var validate = require('validate-firepad-text-operation')
var opJSON = [10, 'hello world', 20]

// Success
validate(opJSON)

// Go on and create a firepad TextOperation
TextOperation.fromJSON(opJSON)
```
Example 2: Successfully invalidate text-operation json
```js
var validate = require('validate-firepad-text-operation')

validate({})
// throws [Error: must be an array]
validate([])
// throws [Error: operation cannot be empty]
validate(['f', 1, 1])
// throws [Error: invalid operation start]
validate([1, 1, 1, 1, 1])
// throws [Error: invalid operation middle]
validate([1, 'f', -1, -1])
// throws [Error: invalid operation end]
```

# License
MIT

---
_Source: https://npm.io/package/validate-firepad-text-operation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
