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.0 to 0.3.1

6

lib/deckardcain.js

@@ -11,4 +11,4 @@ 'use strict';

var SWAGGER_JSON = /^[\uFEFF]?{\n?[\n\t ]*["']swagger["']: ?["']\d\.\d["'],/i;
var SWAGGER_YAML = /(?:^|\n)swagger: ["']\d\.\d["']\n/i;
var SWAGGER_JSON = /^[\uFEFF]?{[\s\S]*["']swagger["']: ?["']\d\.\d["'],?/i;
var SWAGGER_YAML = /(?:^|\n)\s*swagger: ["']\d\.\d["']\n/i;

@@ -29,3 +29,3 @@ var REFRACT_API_DESCRIPTION_ELEMENT_JSON = /[\uFEFF]?\n?\s*["']element["']: ?["']category["']/i;

function identify(source) {
if (source.match(API_BLUEPRINT_HEADER)) {
if (source.substring(0, 11).match(API_BLUEPRINT_HEADER)) {
// There is 'FORMAT: 1A' present at the begining,

@@ -32,0 +32,0 @@ // so we can say it is API Blueprint

{
"name": "deckardcain",
"version": "0.3.0",
"version": "0.3.1",
"description": "Identifies (media) type of API description files",

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

@@ -6,4 +6,4 @@ const API_BLUEPRINT_HEADER = /^[\uFEFF]?(((VERSION:( |\t)2)|(FORMAT:( |\t)(X-)?1A))([\n\r]{1,2}|$))/i;

const SWAGGER_JSON = /^[\uFEFF]?{\n?[\n\t ]*["']swagger["']: ?["']\d\.\d["'],/i;
const SWAGGER_YAML = /(?:^|\n)swagger: ["']\d\.\d["']\n/i;
const SWAGGER_JSON = /^[\uFEFF]?{[\s\S]*["']swagger["']: ?["']\d\.\d["'],?/i;
const SWAGGER_YAML = /(?:^|\n)\s*swagger: ["']\d\.\d["']\n/i;

@@ -24,3 +24,3 @@ const REFRACT_API_DESCRIPTION_ELEMENT_JSON = /[\uFEFF]?\n?\s*["']element["']: ?["']category["']/i;

function identify(source) {
if (source.match(API_BLUEPRINT_HEADER)) {
if (source.substring(0, 11).match(API_BLUEPRINT_HEADER)) {
// There is 'FORMAT: 1A' present at the begining,

@@ -27,0 +27,0 @@ // so we can say it is API Blueprint

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