1
0
Fork 0

chore: Linter warnings

This commit is contained in:
joostdecock 2023-04-15 15:31:25 +02:00
parent d0447c0f77
commit 182c4f4d64
5 changed files with 8 additions and 45 deletions

View file

@ -490,7 +490,7 @@ Path.prototype.intersectsY = function (y) {
Path.prototype.join = function (that, closed = false) {
if (that instanceof Path !== true)
this.log.error('Called `Path.join(that)` but `that` is not a `Path` object')
return __joinPaths([this, that], closed, this.log)
return __joinPaths([this, that], closed)
}
/**
@ -843,8 +843,8 @@ Path.prototype.split = function (point) {
}
}
}
if (firstHalf.length > 0) firstHalf = __joinPaths(firstHalf, false, this.log)
if (secondHalf.length > 0) secondHalf = __joinPaths(secondHalf, false, this.log)
if (firstHalf.length > 0) firstHalf = __joinPaths(firstHalf, false)
if (secondHalf.length > 0) secondHalf = __joinPaths(secondHalf, false)
return [firstHalf, secondHalf]
}
@ -930,9 +930,9 @@ Path.prototype.trim = function () {
first = false
}
let joint
if (trimmedStart.length > 0) joint = __joinPaths(trimmedStart, false, this.log).join(glue)
if (trimmedStart.length > 0) joint = __joinPaths(trimmedStart, false).join(glue)
else joint = glue
if (trimmedEnd.length > 0) joint = joint.join(__joinPaths(trimmedEnd, false, this.log))
if (trimmedEnd.length > 0) joint = joint.join(__joinPaths(trimmedEnd, false))
return joint.trim()
}
@ -1317,7 +1317,7 @@ function __pathOffset(path, distance, log) {
if (!start) start = current
}
return __joinPaths(offset, closed, log)
return __joinPaths(offset, closed)
}
/**

View file

@ -216,7 +216,7 @@ Pattern.prototype.getRenderProps = function () {
...set[p].asProps(),
store: this.setStores[set[p].set],
}
} else if (this.setStores[set?.set]) {
} else if (this.setStores[set.set]) {
this.setStores[set.set].log.info(
`Part${p} is hidden in set ${set.set}. Not adding to render props`
)
@ -383,7 +383,7 @@ Pattern.prototype.__applySettings = function (sets) {
if (!Array.isArray(sets)) throw 'Sets should be an array of settings objects'
if (sets.length === 0) sets.push({}) // Required to load default settings
this.settings = []
for (const i in sets) {
for (let i = 0; i < sets.length; i++) {
// Don't mutate the input itself
const set = { ...sets[i] }
if (!set.options) set.options = {}