diff --git a/package.json b/package.json index b5e7fc9a..e4fd4d4f 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "node-cpplint": "^0.4.0", "nyc": "^10.0.0", "rimraf": "^2.5.4", - "semistandard": "^9.1.0", + "semistandard": "^9.2.1", "unzip": "^0.1.11" }, "license": "Apache-2.0", diff --git a/test/unit/convolve.js b/test/unit/convolve.js index 37f0c5da..2d415549 100644 --- a/test/unit/convolve.js +++ b/test/unit/convolve.js @@ -13,9 +13,11 @@ describe('Convolve', function () { height: 3, scale: 50, offset: 0, - kernel: [ 10, 20, 10, - 0, 0, 0, - 10, 20, 10 ] + kernel: [ + 10, 20, 10, + 0, 0, 0, + 10, 20, 10 + ] }) .toBuffer(function (err, data, info) { if (err) throw err; @@ -31,9 +33,11 @@ describe('Convolve', function () { .convolve({ width: 3, height: 3, - kernel: [ 1, 0, 1, - 2, 0, 2, - 1, 0, 1 ] + kernel: [ + 1, 0, 1, + 2, 0, 2, + 1, 0, 1 + ] }) .toBuffer(function (err, data, info) { if (err) throw err; @@ -50,9 +54,11 @@ describe('Convolve', function () { .convolve({ width: 3, height: 3, - kernel: [ -1, 0, 1, - -2, 0, 2, - -1, 0, 1 ] + kernel: [ + -1, 0, 1, + -2, 0, 2, + -1, 0, 1 + ] }) .toBuffer(function (err, data, info) { if (err) throw err; diff --git a/test/unit/joinChannel.js b/test/unit/joinChannel.js index aa09dc26..dd993d2c 100644 --- a/test/unit/joinChannel.js +++ b/test/unit/joinChannel.js @@ -38,9 +38,11 @@ describe('Image channel insertion', function () { it('Grayscale to RGBA, buffer', function (done) { sharp(fixtures.inputPng) // gray -> red .resize(320, 240) - .joinChannel([fixtures.inputPngTestJoinChannel, - fixtures.inputPngStripesH, - fixtures.inputPngStripesV]) // new green + blue + alpha channel + .joinChannel([ + fixtures.inputPngTestJoinChannel, + fixtures.inputPngStripesH, + fixtures.inputPngStripesV + ]) // new green + blue + alpha channel .toColourspace(sharp.colourspace.srgb) .toBuffer(function (err, data, info) { if (err) throw err; @@ -54,9 +56,11 @@ describe('Image channel insertion', function () { it('Grayscale to RGBA, file', function (done) { sharp(fixtures.inputPng) // gray -> red .resize(320, 240) - .joinChannel([fs.readFileSync(fixtures.inputPngTestJoinChannel), // new green channel - fs.readFileSync(fixtures.inputPngStripesH), // new blue channel - fs.readFileSync(fixtures.inputPngStripesV)]) // new alpha channel + .joinChannel([ + fs.readFileSync(fixtures.inputPngTestJoinChannel), // new green channel + fs.readFileSync(fixtures.inputPngStripesH), // new blue channel + fs.readFileSync(fixtures.inputPngStripesV) // new alpha channel + ]) .toColourspace('srgb') .toBuffer(function (err, data, info) { if (err) throw err; @@ -70,9 +74,11 @@ describe('Image channel insertion', function () { it('Grayscale to CMYK, buffers', function (done) { sharp(fixtures.inputPng) // gray -> magenta .resize(320, 240) - .joinChannel([fs.readFileSync(fixtures.inputPngTestJoinChannel), // new cyan channel - fs.readFileSync(fixtures.inputPngStripesH), // new yellow channel - fs.readFileSync(fixtures.inputPngStripesV)]) // new black channel + .joinChannel([ + fs.readFileSync(fixtures.inputPngTestJoinChannel), // new cyan channel + fs.readFileSync(fixtures.inputPngStripesH), // new yellow channel + fs.readFileSync(fixtures.inputPngStripesV) // new black channel + ]) .toColorspace('cmyk') .toFormat('jpeg') .toBuffer(function (err, data, info) { @@ -92,12 +98,13 @@ describe('Image channel insertion', function () { .then(function (buffers) { sharp(fixtures.inputPng) .resize(320, 240) - .joinChannel(buffers, - { raw: { - width: 320, - height: 240, - channels: 1 - }}) + .joinChannel(buffers, { + raw: { + width: 320, + height: 240, + channels: 1 + } + }) .toBuffer(function (err, data, info) { if (err) throw err; assert.strictEqual(320, info.width); @@ -115,8 +122,10 @@ describe('Image channel insertion', function () { sharp(fixtures.inputPng) // gray -> red .resize(320, 240) .joinChannel([fs.readFileSync(fixtures.inputPngTestJoinChannel)]) // new green channel - .joinChannel([fs.readFileSync(fixtures.inputPngStripesH), // new blue channel - fs.readFileSync(fixtures.inputPngStripesV)]) // new alpha channel + .joinChannel([ + fs.readFileSync(fixtures.inputPngStripesH), // new blue channel + fs.readFileSync(fixtures.inputPngStripesV) // new alpha channel + ]) .toColourspace('srgb') .toBuffer(function (err, data, info) { if (err) throw err; @@ -135,15 +144,13 @@ describe('Image channel insertion', function () { it('Invalid input', function () { assert.throws(function () { - sharp(fixtures.inputJpg) - .joinChannel(1); + sharp(fixtures.inputJpg).joinChannel(1); }); }); it('No arguments', function () { assert.throws(function () { - sharp(fixtures.inputJpg) - .joinChannel(); + sharp(fixtures.inputJpg).joinChannel(); }); }); });