Skip to content

Commit bcd1296

Browse files
authored
fix lgm alert: Useless assignment to local variable (#472)
1 parent 1312e83 commit bcd1296

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function addPatternProperties (location) {
297297
}
298298

299299
function additionalProperty (location) {
300-
let ap = location.schema.additionalProperties
300+
const ap = location.schema.additionalProperties
301301
let code = ''
302302
if (ap === true) {
303303
code += `
@@ -309,10 +309,10 @@ function additionalProperty (location) {
309309

310310
return code
311311
}
312+
312313
let apLocation = mergeLocation(location, 'additionalProperties')
313-
if (ap.$ref) {
314-
apLocation = resolveRef(location, ap.$ref)
315-
ap = apLocation.schema
314+
if (apLocation.schema.$ref) {
315+
apLocation = resolveRef(apLocation, apLocation.schema.$ref)
316316
}
317317

318318
const valueCode = buildValue(apLocation, 'obj[keys[i]]')

0 commit comments

Comments
 (0)