# pizza-validator

> This packages tests if a given object is a valid pizza

Latest version **1.0.2** (published 2024-02-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install pizza-validator
pnpm add pizza-validator
yarn add pizza-validator
bun add pizza-validator
```

Provides the command `pizza-validator`.

## 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.0.2 |
| Published | 2024-02-12 |
| First published | 2024-02-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 17.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Chris Wun |
| Maintainers | kris1 |
| Keywords | pizza |

## Links

- npm: https://www.npmjs.com/package/pizza-validator
- Repository: https://github.com/cis-1962/hw3-project-scaffolding-christopherwun
- Homepage: https://github.com/cis-1962/hw3-project-scaffolding-christopherwun#readme
- Issues: https://github.com/cis-1962/hw3-project-scaffolding-christopherwun/issues
- npm.io page: https://npm.io/package/pizza-validator

## Dependencies (2)

- [zod](https://npm.io/package/zod.md) ^3.22.4
- [typescript](https://npm.io/package/typescript.md) ^5.3.3

## Recent versions

- 1.0.2 (latest) — 2024-02-12
- 1.0.1 — 2024-02-12
- 1.0.0 — 2024-02-12

## README

# Pizza-Validator

A package to determine if objects are valid pizzas!

## Installation

The easiest way to install pizza-validator is from [`npm`](https://www.npmjs.com/):

```sh
npm install pizza-validator
```

## Interface

**validatePizza**`(input)` is the main interface to the library. The`input` parameter is 
an object of any kind. The return value will be a discriminated union type object with 
the fields:

isPizza
errors only if isPizza is false (providing some form of information on why the given object is not a pizza)
pizza only if isPizza is true, which should be our same pizza object but with the type known.

```javascript
import { validatePizza } from 'pizza-validator';
const pizza : object = {
        size: 12,
        crust: 'normal',
        isDeepDish: true,
        toppings: ['screws'],
    };
    const result = validatePizza(pizza);
```

## Command line interface

`ts-node pizza-validator test-pizza.json` can be used to parse a json from the command
line (assuming you have a json named test-pizza).

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