mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Update dev deps, deconstify all the functions, API doc refresh
This commit is contained in:
@@ -27,7 +27,7 @@ const bool = {
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid channel
|
||||
*/
|
||||
const extractChannel = function extractChannel (channel) {
|
||||
function extractChannel (channel) {
|
||||
if (channel === 'red') {
|
||||
channel = 0;
|
||||
} else if (channel === 'green') {
|
||||
@@ -41,7 +41,7 @@ const extractChannel = function extractChannel (channel) {
|
||||
throw new Error('Cannot extract invalid channel ' + channel);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Join one or more channels to the image.
|
||||
@@ -59,7 +59,7 @@ const extractChannel = function extractChannel (channel) {
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
const joinChannel = function joinChannel (images, options) {
|
||||
function joinChannel (images, options) {
|
||||
if (Array.isArray(images)) {
|
||||
images.forEach(function (image) {
|
||||
this.options.joinChannelIn.push(this._createInputDescriptor(image, options));
|
||||
@@ -68,7 +68,7 @@ const joinChannel = function joinChannel (images, options) {
|
||||
this.options.joinChannelIn.push(this._createInputDescriptor(images, options));
|
||||
}
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a bitwise boolean operation on all input image channels (bands) to produce a single channel output image.
|
||||
@@ -86,14 +86,14 @@ const joinChannel = function joinChannel (images, options) {
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
const bandbool = function bandbool (boolOp) {
|
||||
function bandbool (boolOp) {
|
||||
if (is.string(boolOp) && is.inArray(boolOp, ['and', 'or', 'eor'])) {
|
||||
this.options.bandBoolOp = boolOp;
|
||||
} else {
|
||||
throw new Error('Invalid bandbool operation ' + boolOp);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorate the Sharp prototype with channel-related functions.
|
||||
|
||||
Reference in New Issue
Block a user