better-ajv-errors
Advanced tools
Comparing version 1.0.0-next.0 to 1.0.0
@@ -53,5 +53,3 @@ var __create = Object.create; | ||
} | ||
const type = obj.children.filter((child) => { | ||
child && child.key && child.key.value === "type"; | ||
}); | ||
const type = obj.children.filter((child) => child && child.key && child.key.value === "type"); | ||
if (!type.length) { | ||
@@ -58,0 +56,0 @@ return ""; |
@@ -27,5 +27,3 @@ import { getPointers } from "./utils"; | ||
} | ||
const type = obj.children.filter((child) => { | ||
child && child.key && child.key.value === "type"; | ||
}); | ||
const type = obj.children.filter((child) => child && child.key && child.key.value === "type"); | ||
if (!type.length) { | ||
@@ -32,0 +30,0 @@ return ""; |
{ | ||
"name": "better-ajv-errors", | ||
"version": "1.0.0-next.0", | ||
"version": "1.0.0", | ||
"description": "JSON Schema validation for Human", | ||
@@ -42,4 +42,4 @@ "repository": "atlassian/better-ajv-errors", | ||
"format": "prettier --write './src/**/*.js' './.changeset/*.json'", | ||
"test": "jest", | ||
"test-ci": "jest --coverage --colors", | ||
"test": "jest && tsd", | ||
"test-ci": "jest --coverage --colors && tsd", | ||
"screenshot": "svg-term --command='node screenshot' --out=./media/screenshot.svg --padding=5 --width=80 --height=13 --at=1000 --no-cursor --term iterm2 --profile='deep' --window", | ||
@@ -74,3 +74,4 @@ "prepare": "is-ci || husky install", | ||
"prettier": "^2.4.1", | ||
"svg-term-cli": "^2.1.1" | ||
"svg-term-cli": "^2.1.1", | ||
"tsd": "^0.18.0" | ||
}, | ||
@@ -77,0 +78,0 @@ "peerDependencies": { |
@@ -1,32 +0,24 @@ | ||
import { ErrorObject } from 'ajv'; | ||
import type { ErrorObject } from 'ajv'; | ||
declare var betterAjvErrors: betterAjvErrors.IBetterAjvErrors; | ||
export interface IOutputError { | ||
start: { line: number; column: number; offset: number }; | ||
// Optional for required | ||
end?: { line: number; column: number; offset: number }; | ||
error: string; | ||
suggestion?: string; | ||
} | ||
export = betterAjvErrors; | ||
export as namespace betterAjvErrors; | ||
export interface IInputOptions { | ||
format?: 'cli' | 'js'; | ||
indent?: number | null; | ||
declare namespace betterAjvErrors { | ||
export interface IInputOptions { | ||
format?: 'cli' | 'js'; | ||
indent?: number | null; | ||
/** Raw JSON used when highlighting error location */ | ||
json?: string | null; | ||
} | ||
/** Raw JSON used when highlighting error location */ | ||
json?: string | null; | ||
} | ||
export interface IOutputError { | ||
start: { line: number; column: number; offset: number }; | ||
end?: { line: number; column: number; offset: number }; | ||
error: string; | ||
suggestion?: string; | ||
} | ||
export interface IBetterAjvErrors { | ||
( | ||
schema: any, | ||
data: any, | ||
errors?: ErrorObject[] | null, | ||
options?: betterAjvErrors.IInputOptions | ||
): betterAjvErrors.IOutputError[] | void; | ||
} | ||
} | ||
export default function <S, T, Options extends IInputOptions>( | ||
schema: S, | ||
data: T, | ||
errors: Array<ErrorObject>, | ||
options?: Options | ||
): Options extends { format: 'js' } ? Array<IOutputError> : void; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
108315
65
1
0
19
1269