Socket
Socket
Sign inDemoInstall

@oada/formats

Package Overview
Dependencies
69
Maintainers
8
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @oada/formats

Reworked OADA formats


Version published
Weekly downloads
61
increased by1425%
Maintainers
8
Install size
77.7 MB
Created
Weekly downloads
 

Readme

Source

@OADA/formats

This package is a library for using OADA/formats with JavaScript/TypeScript. It is mainly an Ajv instance pre-packaged with the OADA schemas.

Installation

yarn add @oada/formats

Usage

This TypeScript/JavaScript library exports an async function that resolves to an Ajv instance which is loaded with all the schemas from this project.

import loadAllFormats from '@oada/formats';

const obj = {
  /* Properties and stuff here */
};

const formats = await loadAllFormats();

// Check that obj matches the format for and OADA bookmarks document
formats.validate('https://formats.openag.io/oada/bookmarks.schema', obj);

In addition to being loaded with all the OADA formats, the returned Ajv instance is also augmented to be able to resolve content types to the relevant schema.

// Returns the schema for an OADA Bookmarks document
const { schema } = formats.getSchema('applications/vnd.oada.bookmarks.1+json');

Keywords

FAQs

Last updated on 05 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc