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

zod-metadata

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zod-metadata - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "zod-metadata",
"version": "1.0.0",
"version": "1.0.1",
"description": "Extends Zod with metadata",

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

@@ -9,6 +9,6 @@ # zod-metadata

## Usage
## Register the Zod extension
### Automatic
Import `zod-metadata/register` the top of your entry files:
Import `zod-metadata/register` at the top of your entry files:

@@ -62,1 +62,20 @@ **JavaScript**

```
## API
The API provices two methods that will read and write to `schema._def.meta`.
### `schema.meta(meta: Record<string, unknown>): this`
Accumulates metadata mutating the schema:
```javascript
schema
.meta({ key1: value1 })
.meta({ key2: value2 });
```
### `schema.getMeta(): Record<string, unknown>`
Returns the metadata:
```javascript
schema.getMeta(); // => { key1: value1, key2: value2 }
```
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