Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@oada/media-types

Package Overview
Dependencies
Maintainers
8
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oada/media-types

OADA formats media type resolution

latest
Source
npmnpm
Version
4.0.0
Version published
Maintainers
8
Created
Source

@OADA/media-types

This package is a library for resolving media types to their corresponding OADA schema(s).

Installation

yarn add @oada/media-types

Usage

The library takes a string, Request, or Response and returns an array of schema $ids. If it cannot determine a corresponding schema, the array will be empty.

import mediaType2schema from '@oada/media-types';

// ['https://formats.openag.io/oada/bookmarks/v1.schema.json']
const schema = mediaType2schema('application/vnd.oada.bookmarks.1+json');

// Or when dealing with http requests (e.g., in express)
app.use((req) => {
  const schema = mediaType2schema(req);
});

Keywords

oada

FAQs

Package last updated on 05 Apr 2024

Did you know?

Socket

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