Skip to content

Commit

Permalink
fix: minor linting issues (#2383)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoniangreen authored Feb 23, 2024
1 parent 0ca8776 commit 95218d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/compile/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@ export function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): Loc
traverse(schema, {allKeys: true}, (sch, jsonPtr, _, parentJsonPtr) => {
if (parentJsonPtr === undefined) return
const fullPath = pathPrefix + jsonPtr
let baseId = baseIds[parentJsonPtr]
if (typeof sch[schemaId] == "string") baseId = addRef.call(this, sch[schemaId])
let innerBaseId = baseIds[parentJsonPtr]
if (typeof sch[schemaId] == "string") innerBaseId = addRef.call(this, sch[schemaId])
addAnchor.call(this, sch.$anchor)
addAnchor.call(this, sch.$dynamicAnchor)
baseIds[jsonPtr] = baseId
baseIds[jsonPtr] = innerBaseId

function addRef(this: Ajv, ref: string): string {
// eslint-disable-next-line @typescript-eslint/unbound-method
const _resolve = this.opts.uriResolver.resolve
ref = normalizeId(baseId ? _resolve(baseId, ref) : ref)
ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref)
if (schemaRefs.has(ref)) throw ambiguos(ref)
schemaRefs.add(ref)
let schOrRef = this.refs[ref]
Expand Down
1 change: 1 addition & 0 deletions lib/runtime/parseJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export function parseJsonString(s: string, pos: number): string | undefined {
while (count--) {
code <<= 4
c = s[pos]
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (c === undefined) {
errorMessage("unexpected end")
return undefined
Expand Down

0 comments on commit 95218d3

Please sign in to comment.