deckardcain
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -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 |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
10745
1