diff --git a/lib/channel.js b/lib/channel.js index 977ea386..5e3e7aee 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -158,6 +158,7 @@ function bandbool (boolOp) { /** * Decorate the Sharp prototype with channel-related functions. + * @module Sharp * @private */ module.exports = function (Sharp) { diff --git a/lib/colour.js b/lib/colour.js index 9962fb57..305f7253 100644 --- a/lib/colour.js +++ b/lib/colour.js @@ -159,6 +159,7 @@ function _setBackgroundColourOption (key, value) { /** * Decorate the Sharp prototype with colour-related functions. + * @module Sharp * @private */ module.exports = function (Sharp) { diff --git a/lib/composite.js b/lib/composite.js index 28e83788..892c6298 100644 --- a/lib/composite.js +++ b/lib/composite.js @@ -202,6 +202,7 @@ function composite (images) { /** * Decorate the Sharp prototype with composite-related functions. + * @module Sharp * @private */ module.exports = function (Sharp) { diff --git a/lib/constructor.js b/lib/constructor.js index 3150d1ef..73e90a67 100644 --- a/lib/constructor.js +++ b/lib/constructor.js @@ -449,6 +449,7 @@ Object.assign(Sharp.prototype, { clone }); /** * Export constructor. + * @module Sharp * @private */ module.exports = Sharp; diff --git a/lib/input.js b/lib/input.js index 9e06fafe..e2a494cb 100644 --- a/lib/input.js +++ b/lib/input.js @@ -643,6 +643,7 @@ function stats (callback) { /** * Decorate the Sharp prototype with input-related functions. + * @module Sharp * @private */ module.exports = function (Sharp) { diff --git a/lib/operation.js b/lib/operation.js index c47fbadf..6135f37c 100644 --- a/lib/operation.js +++ b/lib/operation.js @@ -930,6 +930,7 @@ function modulate (options) { /** * Decorate the Sharp prototype with operation-related functions. + * @module Sharp * @private */ module.exports = function (Sharp) { diff --git a/lib/output.js b/lib/output.js index 137932cc..bd3a94cf 100644 --- a/lib/output.js +++ b/lib/output.js @@ -1551,6 +1551,7 @@ function _pipeline (callback, stack) { /** * Decorate the Sharp prototype with output-related functions. + * @module Sharp * @private */ module.exports = function (Sharp) { diff --git a/lib/resize.js b/lib/resize.js index e31f8527..8fc6c58a 100644 --- a/lib/resize.js +++ b/lib/resize.js @@ -569,6 +569,7 @@ function trim (options) { /** * Decorate the Sharp prototype with resize-related functions. + * @module Sharp * @private */ module.exports = function (Sharp) { diff --git a/lib/utility.js b/lib/utility.js index 89ee9dfd..3c7286fb 100644 --- a/lib/utility.js +++ b/lib/utility.js @@ -280,6 +280,7 @@ function unblock (options) { /** * Decorate the Sharp class with utility-related functions. + * @module Sharp * @private */ module.exports = function (Sharp) { diff --git a/package.json b/package.json index 5893a5a2..fa8feb9a 100644 --- a/package.json +++ b/package.json @@ -170,13 +170,12 @@ "@img/sharp-libvips-win32-ia32": "1.0.4", "@img/sharp-libvips-win32-x64": "1.0.4", "@types/node": "*", - "async": "^3.2.5", "cc": "^3.0.1", "emnapi": "^1.2.0", "exif-reader": "^2.0.1", "extract-zip": "^2.0.1", "icc": "^3.0.0", - "jsdoc-to-markdown": "^8.0.3", + "jsdoc-to-markdown": "^9.0.0", "license-checker": "^25.0.1", "mocha": "^10.7.3", "node-addon-api": "^8.1.0", @@ -184,7 +183,7 @@ "prebuild": "^13.0.1", "semistandard": "^17.0.0", "tar-fs": "^3.0.6", - "tsd": "^0.31.1" + "tsd": "^0.31.2" }, "license": "Apache-2.0", "engines": { diff --git a/test/unit/tile.js b/test/unit/tile.js index 8ff2eacc..d1b3d831 100644 --- a/test/unit/tile.js +++ b/test/unit/tile.js @@ -7,7 +7,6 @@ const fs = require('fs'); const path = require('path'); const assert = require('assert'); -const eachLimit = require('async/eachLimit'); const extractZip = require('extract-zip'); const sharp = require('../../'); @@ -31,11 +30,10 @@ const assertDeepZoomTiles = function (directory, expectedSize, expectedLevels, d }); }); // Verify each tile is <= expectedSize - eachLimit(tiles, 8, function (tile, done) { - sharp(tile).metadata(function (err, metadata) { - if (err) { - done(err); - } else { + Promise.all(tiles.map(function (tile) { + return sharp(tile) + .metadata() + .then(function (metadata) { assert.strictEqual('jpeg', metadata.format); assert.strictEqual('srgb', metadata.space); assert.strictEqual(3, metadata.channels); @@ -43,10 +41,10 @@ const assertDeepZoomTiles = function (directory, expectedSize, expectedLevels, d assert.strictEqual(false, metadata.hasAlpha); assert.strictEqual(true, metadata.width <= expectedSize); assert.strictEqual(true, metadata.height <= expectedSize); - done(); - } - }); - }, done); + }); + })) + .then(() => done()) + .catch(done); }; const assertZoomifyTiles = function (directory, expectedTileSize, expectedLevels, done) {