mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Upgrade semistandard, appease new linter rules
This commit is contained in:
parent
854ed65016
commit
a41c62be2b
28
lib/is.js
28
lib/is.js
@ -138,18 +138,18 @@ const invalidParameterError = function (name, expected, actual) {
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
defined: defined,
|
||||
object: object,
|
||||
plainObject: plainObject,
|
||||
fn: fn,
|
||||
bool: bool,
|
||||
buffer: buffer,
|
||||
typedArray: typedArray,
|
||||
arrayBuffer: arrayBuffer,
|
||||
string: string,
|
||||
number: number,
|
||||
integer: integer,
|
||||
inRange: inRange,
|
||||
inArray: inArray,
|
||||
invalidParameterError: invalidParameterError
|
||||
defined,
|
||||
object,
|
||||
plainObject,
|
||||
fn,
|
||||
bool,
|
||||
buffer,
|
||||
typedArray,
|
||||
arrayBuffer,
|
||||
string,
|
||||
number,
|
||||
integer,
|
||||
inRange,
|
||||
inArray,
|
||||
invalidParameterError
|
||||
};
|
||||
|
@ -1370,7 +1370,7 @@ function _pipeline (callback) {
|
||||
reject(err);
|
||||
} else {
|
||||
if (this.options.resolveWithObject) {
|
||||
resolve({ data: data, info: info });
|
||||
resolve({ data, info });
|
||||
} else {
|
||||
resolve(data);
|
||||
}
|
||||
|
@ -172,7 +172,7 @@
|
||||
"mocha": "^10.2.0",
|
||||
"nyc": "^15.1.0",
|
||||
"prebuild": "^12.1.0",
|
||||
"semistandard": "^16.0.1",
|
||||
"semistandard": "^17.0.0",
|
||||
"tar-fs": "^3.0.4",
|
||||
"tsd": "^0.29.0"
|
||||
},
|
||||
|
@ -190,8 +190,8 @@ async.series({
|
||||
srcPath: fixtures.inputJpg,
|
||||
dstPath: outputJpg,
|
||||
quality: 0.8,
|
||||
width: width,
|
||||
height: height,
|
||||
width,
|
||||
height,
|
||||
format: 'jpg',
|
||||
filter: 'Lanczos'
|
||||
}, function (err) {
|
||||
@ -795,7 +795,7 @@ async.series({
|
||||
imagemagick.resize({
|
||||
srcPath: fixtures.inputPngAlphaPremultiplicationLarge,
|
||||
dstPath: outputPng,
|
||||
width: width,
|
||||
width,
|
||||
height: heightPng,
|
||||
filter: 'Lanczos',
|
||||
customArgs: [
|
||||
|
@ -269,7 +269,7 @@ describe('composite', () => {
|
||||
.resize(80)
|
||||
.composite([{
|
||||
input: fixtures.inputPngWithTransparency16bit,
|
||||
gravity: gravity
|
||||
gravity
|
||||
}])
|
||||
.toBuffer((err, data, info) => {
|
||||
if (err) throw err;
|
||||
@ -314,7 +314,7 @@ describe('composite', () => {
|
||||
.composite([{
|
||||
input: fixtures.inputPngWithTransparency16bit,
|
||||
tile: true,
|
||||
gravity: gravity
|
||||
gravity
|
||||
}])
|
||||
.toBuffer((err, data, info) => {
|
||||
if (err) throw err;
|
||||
|
@ -40,7 +40,7 @@ describe('Extend', function () {
|
||||
sharp(fixtures.inputWebPAnimated, { pages: -1 })
|
||||
.resize(120)
|
||||
.extend({
|
||||
extendWith: extendWith,
|
||||
extendWith,
|
||||
top: 40,
|
||||
bottom: 40,
|
||||
left: 40,
|
||||
@ -58,7 +58,7 @@ describe('Extend', function () {
|
||||
sharp(fixtures.inputJpg)
|
||||
.resize(120)
|
||||
.extend({
|
||||
extendWith: extendWith,
|
||||
extendWith,
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
@ -77,7 +77,7 @@ describe('Extend', function () {
|
||||
sharp(fixtures.inputPngWithTransparency16bit)
|
||||
.resize(120)
|
||||
.extend({
|
||||
extendWith: extendWith,
|
||||
extendWith,
|
||||
top: 50,
|
||||
left: 10,
|
||||
right: 35,
|
||||
@ -94,7 +94,7 @@ describe('Extend', function () {
|
||||
it(`PNG with 2 channels (${extendWith})`, function (done) {
|
||||
sharp(fixtures.inputPngWithGreyAlpha)
|
||||
.extend({
|
||||
extendWith: extendWith,
|
||||
extendWith,
|
||||
top: 50,
|
||||
bottom: 50,
|
||||
left: 80,
|
||||
|
@ -914,7 +914,7 @@ describe('Input/output', function () {
|
||||
channels: 3,
|
||||
background: { r: 0, g: 255, b: 0 }
|
||||
};
|
||||
sharp({ create: create })
|
||||
sharp({ create })
|
||||
.jpeg()
|
||||
.toBuffer(function (err, data, info) {
|
||||
if (err) throw err;
|
||||
@ -932,7 +932,7 @@ describe('Input/output', function () {
|
||||
channels: 4,
|
||||
background: { r: 255, g: 0, b: 0, alpha: 128 }
|
||||
};
|
||||
sharp({ create: create })
|
||||
sharp({ create })
|
||||
.png()
|
||||
.toBuffer(function (err, data, info) {
|
||||
if (err) throw err;
|
||||
@ -951,7 +951,7 @@ describe('Input/output', function () {
|
||||
background: { r: 0, g: 0, b: 0 }
|
||||
};
|
||||
assert.throws(function () {
|
||||
sharp({ create: create });
|
||||
sharp({ create });
|
||||
});
|
||||
});
|
||||
it('Missing background', function () {
|
||||
@ -961,7 +961,7 @@ describe('Input/output', function () {
|
||||
channels: 3
|
||||
};
|
||||
assert.throws(function () {
|
||||
sharp({ create: create });
|
||||
sharp({ create });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -36,7 +36,7 @@ describe('JPEG', function () {
|
||||
[-1, 88.2, 'test'].forEach(function (quality) {
|
||||
it(quality.toString(), function () {
|
||||
assert.throws(function () {
|
||||
sharp().jpeg({ quality: quality });
|
||||
sharp().jpeg({ quality });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -646,7 +646,7 @@ describe('Resize dimensions', function () {
|
||||
].forEach(function (kernel) {
|
||||
it(`kernel ${kernel}`, function (done) {
|
||||
sharp(fixtures.inputJpg)
|
||||
.resize(320, null, { kernel: kernel })
|
||||
.resize(320, null, { kernel })
|
||||
.toBuffer(function (err, data, info) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual('jpeg', info.format);
|
||||
|
@ -66,7 +66,7 @@ describe('Text to image', function () {
|
||||
const text = sharp({
|
||||
text: {
|
||||
text: 'Hello, world!',
|
||||
dpi: dpi
|
||||
dpi
|
||||
}
|
||||
});
|
||||
text.toFile(output, function (err, info) {
|
||||
@ -87,7 +87,7 @@ describe('Text to image', function () {
|
||||
text: {
|
||||
text: '<span foreground="red" font="100">red</span><span font="50" background="cyan">blue</span>',
|
||||
rgba: true,
|
||||
dpi: dpi
|
||||
dpi
|
||||
}
|
||||
});
|
||||
text.toFile(output, function (err, info) {
|
||||
@ -146,7 +146,7 @@ describe('Text to image', function () {
|
||||
text: {
|
||||
text: '<span background="cyan">cool</span>',
|
||||
font: 'sans 30',
|
||||
dpi: dpi,
|
||||
dpi,
|
||||
rgba: true
|
||||
}
|
||||
},
|
||||
|
@ -125,7 +125,7 @@ describe('Tile', function () {
|
||||
[1, 8192].forEach(function (size) {
|
||||
assert.doesNotThrow(function () {
|
||||
sharp().tile({
|
||||
size: size
|
||||
size
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -135,7 +135,7 @@ describe('Tile', function () {
|
||||
['zoinks', 1.1, -1, 0, 8193].forEach(function (size) {
|
||||
assert.throws(function () {
|
||||
sharp().tile({
|
||||
size: size
|
||||
size
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -146,7 +146,7 @@ describe('Tile', function () {
|
||||
assert.doesNotThrow(function () {
|
||||
sharp().tile({
|
||||
size: 8192,
|
||||
overlap: overlap
|
||||
overlap
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -156,7 +156,7 @@ describe('Tile', function () {
|
||||
['zoinks', 1.1, -1, 8193].forEach(function (overlap) {
|
||||
assert.throws(function () {
|
||||
sharp().tile({
|
||||
overlap: overlap
|
||||
overlap
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -166,7 +166,7 @@ describe('Tile', function () {
|
||||
['fs', 'zip'].forEach(function (container) {
|
||||
assert.doesNotThrow(function () {
|
||||
sharp().tile({
|
||||
container: container
|
||||
container
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -176,7 +176,7 @@ describe('Tile', function () {
|
||||
['zoinks', 1].forEach(function (container) {
|
||||
assert.throws(function () {
|
||||
sharp().tile({
|
||||
container: container
|
||||
container
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -186,7 +186,7 @@ describe('Tile', function () {
|
||||
['dz', 'google', 'zoomify'].forEach(function (layout) {
|
||||
assert.doesNotThrow(function () {
|
||||
sharp().tile({
|
||||
layout: layout
|
||||
layout
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -196,7 +196,7 @@ describe('Tile', function () {
|
||||
['zoinks', 1].forEach(function (layout) {
|
||||
assert.throws(function () {
|
||||
sharp().tile({
|
||||
layout: layout
|
||||
layout
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -254,7 +254,7 @@ describe('Tile', function () {
|
||||
[90, 270, -90].forEach(function (angle) {
|
||||
assert.doesNotThrow(function () {
|
||||
sharp().tile({
|
||||
angle: angle
|
||||
angle
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -264,7 +264,7 @@ describe('Tile', function () {
|
||||
['zoinks', 1.1, -1, 27].forEach(function (angle) {
|
||||
assert.throws(function () {
|
||||
sharp().tile({
|
||||
angle: angle
|
||||
angle
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user