-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept json schema #35
Conversation
Pull Request Test Coverage Report for Build 285
💛 - Coveralls |
src/index.js
Outdated
} | ||
|
||
function getJsonSchema(pathOrSchema) { | ||
if (pathOrSchema instanceof Object) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it easier to check if pathOrSchema
is string? Judging by Lodash implementation, check is not that simple and there might be edge cases (https://github.com/lodash/lodash/blob/master/isObject.js)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
const yaml = require('js-yaml'); | ||
const fs = require('fs'); | ||
|
||
const schemaValidatorGenerator = require('../../../src/index'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't index
at the end redundant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
Closes #36