mirror of
https://github.com/lovell/sharp.git
synced 2025-12-18 23:05:04 +01:00
Switch linter from semistandard to biome
Uses the recommended rules apart from complexity/useArrowFunction, which would affect about 1700 lines of code with little benefit right now. This is something that can be addressed over time.
This commit is contained in:
10
lib/input.js
10
lib/input.js
@@ -1,8 +1,6 @@
|
||||
// Copyright 2013 Lovell Fuller and others.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
'use strict';
|
||||
|
||||
const is = require('./is');
|
||||
const sharp = require('./sharp');
|
||||
|
||||
@@ -54,7 +52,7 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
|
||||
const inputDescriptor = {
|
||||
autoOrient: false,
|
||||
failOn: 'warning',
|
||||
limitInputPixels: Math.pow(0x3FFF, 2),
|
||||
limitInputPixels: 0x3FFF ** 2,
|
||||
ignoreIcc: false,
|
||||
unlimited: false,
|
||||
sequentialRead: true
|
||||
@@ -150,7 +148,7 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
|
||||
if (is.defined(inputOptions.limitInputPixels)) {
|
||||
if (is.bool(inputOptions.limitInputPixels)) {
|
||||
inputDescriptor.limitInputPixels = inputOptions.limitInputPixels
|
||||
? Math.pow(0x3FFF, 2)
|
||||
? 0x3FFF ** 2
|
||||
: 0;
|
||||
} else if (is.integer(inputOptions.limitInputPixels) && is.inRange(inputOptions.limitInputPixels, 0, Number.MAX_SAFE_INTEGER)) {
|
||||
inputDescriptor.limitInputPixels = inputOptions.limitInputPixels;
|
||||
@@ -513,7 +511,7 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
|
||||
}
|
||||
}
|
||||
} else if (is.defined(inputOptions)) {
|
||||
throw new Error('Invalid input options ' + inputOptions);
|
||||
throw new Error(`Invalid input options ${inputOptions}`);
|
||||
}
|
||||
return inputDescriptor;
|
||||
}
|
||||
@@ -525,7 +523,7 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
|
||||
* @param {string} encoding - unused
|
||||
* @param {Function} callback
|
||||
*/
|
||||
function _write (chunk, encoding, callback) {
|
||||
function _write (chunk, _encoding, callback) {
|
||||
/* istanbul ignore else */
|
||||
if (Array.isArray(this.options.input.buffer)) {
|
||||
/* istanbul ignore else */
|
||||
|
||||
Reference in New Issue
Block a user