New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

arri-validate

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arri-validate - npm Package Compare versions

Comparing version 0.1.0-beta.10 to 0.1.0-beta.11

2

package.json
{
"name": "arri-validate",
"version": "0.1.0-beta.10",
"version": "0.1.0-beta.11",
"type": "module",

@@ -5,0 +5,0 @@ "main": "./dist/index.cjs",

@@ -5,6 +5,16 @@ # Arri Validate

A type builder and validation library built on top of the [Json Type Definition (RFC 8927)](https://jsontypedef.com) . It uses [AJV](https://ajv.js.org/guide/typescript.html) for parsing and serialization. This library is pretty similar to [Typebox](https://github.com/sinclairzx81/typebox) except that it creates Json Type Definition (JTD) objects instead of Json Schema objects.
A type builder and validation library built on top of the [Json Type Definition (RFC 8927)](https://jsontypedef.com) This library is pretty similar to [Typebox](https://github.com/sinclairzx81/typebox) except that it creates Json Type Definition (JTD) objects instead of Json Schema objects.
A lot of inspiration was taken from both [Typebox](https://github.com/sinclairzx81/typebox) and [Zod](https://github.com/colinhacks/zod) when designing this library
## Installation
```bash
# npm
npm install arri-validate
# pnpm
pnpm install arri-validate
```
## Example

@@ -22,6 +32,14 @@

// passes
const result = a.parse(User, `{"id": "1", "name": "john doe"}`);
// fails
const result = a.parse(User, `{"id": "1", "name": null}`);
// passes and returns User
a.parse(User, `{"id": "1", "name": "John Doe"}`);
// throws error
a.parse(User, `{"id": "1", "name": null}`);
// returns true
a.validate(User, { id: "1", name: "John Doe" });
// returns false
a.validate(User, { id: "1", name: null });
// outputs valid json
a.serialize(User, { id: "1", name: "John Doe" });
```

@@ -28,0 +46,0 @@

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