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 colourspace = {
* @returns {Sharp}
* @throws {Error} Invalid parameter
*/
const background = function background (rgba) {
function background (rgba) {
const colour = color(rgba);
this.options.background = [
colour.red(),
@@ -36,7 +36,7 @@ const background = function background (rgba) {
Math.round(colour.alpha() * 255)
];
return this;
};
}
/**
* Convert to 8-bit greyscale; 256 shades of grey.
@@ -48,19 +48,19 @@ const background = function background (rgba) {
* @param {Boolean} [greyscale=true]
* @returns {Sharp}
*/
const greyscale = function greyscale (greyscale) {
function greyscale (greyscale) {
this.options.greyscale = is.bool(greyscale) ? greyscale : true;
return this;
};
}
/**
* Alternative spelling of `greyscale`.
* @param {Boolean} [grayscale=true]
* @returns {Sharp}
*/
const grayscale = function grayscale (grayscale) {
function grayscale (grayscale) {
return this.greyscale(grayscale);
};
}
/**
* Set the output colourspace.
@@ -69,13 +69,13 @@ const grayscale = function grayscale (grayscale) {
* @returns {Sharp}
* @throws {Error} Invalid parameters
*/
const toColourspace = function toColourspace (colourspace) {
function toColourspace (colourspace) {
if (!is.string(colourspace)) {
throw new Error('Invalid output colourspace ' + colourspace);
}
this.options.colourspace = colourspace;
return this;
};
}
/**
* Alternative spelling of `toColourspace`.
@@ -83,9 +83,9 @@ const toColourspace = function toColourspace (colourspace) {
* @returns {Sharp}
* @throws {Error} Invalid parameters
*/
const toColorspace = function toColorspace (colorspace) {
function toColorspace (colorspace) {
return this.toColourspace(colorspace);
};
}
/**
* Decorate the Sharp prototype with colour-related functions.