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

deckardcain

Package Overview
Dependencies
Maintainers
5
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deckardcain - npm Package Compare versions

Comparing version 0.3.5 to 0.4.0

14

lib/deckardcain.js

@@ -22,2 +22,7 @@ 'use strict';

exports.SWAGGER_YAML = SWAGGER_YAML;
var OPENAPI_JSON = /^[\uFEFF]?{[\s\S]*["']openapi["']\s*:\s*["']\d\.\d+.\d+["'],?/i;
exports.OPENAPI_JSON = OPENAPI_JSON;
var OPENAPI_YAML = /(?:^|\n)\s*openapi: ["']\d\.\d+.\d+["']\n/i;
exports.OPENAPI_YAML = OPENAPI_YAML;
var REFRACT_API_DESCRIPTION_ELEMENT_JSON = /[\uFEFF]?\n?\s*["']element["']\s*:\s*["']category["']/i;

@@ -58,2 +63,11 @@ exports.REFRACT_API_DESCRIPTION_ELEMENT_JSON = REFRACT_API_DESCRIPTION_ELEMENT_JSON;

// see https://stackoverflow.com/questions/52541842/what-is-the-media-type-of-an-openapi-schema
if (source.match(OPENAPI_YAML)) {
return 'application/vnd.oai.openapi';
}
if (source.match(OPENAPI_JSON)) {
return 'application/vnd.oai.openapi+json';
}
if (source.match(REFRACT_API_DESCRIPTION_ELEMENT_JSON) && source.match(REFRACT_API_DESCRIPTION_CLASS_JSON) && !source.match(REFRACT_PARSE_RESULT_ELEMENT_JSON)) {

@@ -60,0 +74,0 @@ // File contains element `category` with class `api`, but

2

package.json
{
"name": "deckardcain",
"version": "0.3.5",
"version": "0.4.0",
"description": "Identifies (media) type of API description files",

@@ -5,0 +5,0 @@ "main": "lib/deckardcain",

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