Comparing version 0.5.1 to 0.5.2
36
jjve.js
@@ -7,2 +7,19 @@ (function() { | ||
function isArray(obj) { | ||
if (typeof Array.isArray === 'function') { | ||
return Array.isArray(obj); | ||
} | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
} | ||
function allowsType(schema, type) { | ||
if (typeof schema.type === 'string') { | ||
return schema.type === type; | ||
} | ||
if (isArray(schema.type)) { | ||
return schema.type.indexOf(type) !== -1; | ||
} | ||
return false; | ||
} | ||
var keys = Object.keys(o.validation); | ||
@@ -205,3 +222,3 @@ | ||
if (o.schema.$ref) { | ||
if (o.schema && o.schema.$ref) { | ||
if (o.schema.$ref.match(/#\/definitions\//)) { | ||
@@ -283,19 +300,2 @@ o.schema = o.definitions[o.schema.$ref.slice(14)]; | ||
function allowsType(schema, type) { | ||
if (typeof schema.type === 'string') { | ||
return schema.type === type; | ||
} | ||
if (isArray(schema.type)) { | ||
return schema.type.indexOf(type) !== -1; | ||
} | ||
return false; | ||
} | ||
function isArray(obj) { | ||
if (typeof Array.isArray === 'function') { | ||
return Array.isArray(obj); | ||
} | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
} | ||
function formatPath(options) { | ||
@@ -302,0 +302,0 @@ var root = options.hasOwnProperty('root') ? |
{ | ||
"name": "jjve", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "Render JJV errors", | ||
"main": "jjve.js", | ||
"devDependencies": { | ||
"istanbul": "^0.3.0", | ||
"jjv": "^1.0.0", | ||
"jscs": "^1.4.5", | ||
"jshint": "^2.5.1", | ||
"mocha": "^2.2.3", | ||
"should": "^5.2.0" | ||
"istanbul": "^0.4.5", | ||
"jjv": "^1.0.2", | ||
"jscs": "^3.0.7", | ||
"jshint": "^2.9.5", | ||
"mocha": "^3.5.3", | ||
"should": "^13.1.0" | ||
}, | ||
@@ -14,0 +14,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15001