Update dev deps, deconstify all the functions, API doc refresh

This commit is contained in:
Lovell Fuller
2017-03-31 21:42:20 +01:00
parent 4001c4a48a
commit 27fb864ac4
15 changed files with 128 additions and 125 deletions

View File

@@ -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.