mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Tests: require 100% branch coverage to pass
Remove old coverage tooling, coveralls
This commit is contained in:
@@ -511,15 +511,12 @@ function trim (trim) {
|
||||
}
|
||||
} else if (is.object(trim)) {
|
||||
this._setBackgroundColourOption('trimBackground', trim.background);
|
||||
|
||||
if (!is.defined(trim.threshold)) {
|
||||
this.options.trimThreshold = 10;
|
||||
} else if (is.number(trim.threshold)) {
|
||||
if (trim.threshold >= 0) {
|
||||
this.options.trimThreshold = trim.threshold;
|
||||
} else {
|
||||
throw is.invalidParameterError('threshold', 'positive number', trim);
|
||||
}
|
||||
} else if (is.number(trim.threshold) && trim.threshold >= 0) {
|
||||
this.options.trimThreshold = trim.threshold;
|
||||
} else {
|
||||
throw is.invalidParameterError('threshold', 'positive number', trim);
|
||||
}
|
||||
} else {
|
||||
throw is.invalidParameterError('trim', 'string, number or object', trim);
|
||||
|
||||
Reference in New Issue
Block a user