From e75991b49ed06fec3d053d77d0be17ef67da1379 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sat, 12 Oct 2019 15:54:17 +0200 Subject: [PATCH] Consistently use `number` for numeric data types in JSDoc comments Sometimes we also used `Number` and `integer`, but `number` is what the JSDoc documentation recommends. --- src/core/annotation.js | 6 +++--- src/core/colorspace.js | 12 ++++++------ src/core/core_utils.js | 2 +- src/core/image.js | 10 +++++----- web/ui_utils.js | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/core/annotation.js b/src/core/annotation.js index 8fd3605be..fbfd88056 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -530,7 +530,7 @@ class AnnotationBorderStyle { * * @public * @memberof AnnotationBorderStyle - * @param {integer} width - The width. + * @param {number} width - The width. * @param {Array} rect - The annotation `Rect` entry. */ setWidth(width, rect = [0, 0, 0, 0]) { @@ -642,7 +642,7 @@ class AnnotationBorderStyle { * * @public * @memberof AnnotationBorderStyle - * @param {integer} radius - The horizontal corner radius + * @param {number} radius - The horizontal corner radius. */ setHorizontalCornerRadius(radius) { if (Number.isInteger(radius)) { @@ -655,7 +655,7 @@ class AnnotationBorderStyle { * * @public * @memberof AnnotationBorderStyle - * @param {integer} radius - The vertical corner radius + * @param {number} radius - The vertical corner radius. */ setVerticalCornerRadius(radius) { if (Number.isInteger(radius)) { diff --git a/src/core/colorspace.js b/src/core/colorspace.js index 11d420ac1..1c666acac 100644 --- a/src/core/colorspace.js +++ b/src/core/colorspace.js @@ -22,11 +22,11 @@ import { isDict, isName, isStream } from './primitives'; * Resizes an RGB image with 3 components. * @param {TypedArray} src - The source buffer. * @param {TypedArray} dest - The destination buffer. - * @param {Number} w1 - Original width. - * @param {Number} h1 - Original height. - * @param {Number} w2 - New width. - * @param {Number} h2 - New height. - * @param {Number} alpha01 - Size reserved for the alpha channel. + * @param {number} w1 - Original width. + * @param {number} h1 - Original height. + * @param {number} w2 - New width. + * @param {number} h2 - New height. + * @param {number} alpha01 - Size reserved for the alpha channel. */ function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) { const COMPONENTS = 3; @@ -390,7 +390,7 @@ class ColorSpace { * This does not handle Lab, Indexed, or Pattern decode maps since they are * slightly different. * @param {Array} decode - Decode map (usually from an image). - * @param {Number} numComps - Number of components the color space has. + * @param {number} numComps - Number of components the color space has. */ static isDefaultDecode(decode, numComps) { if (!Array.isArray(decode)) { diff --git a/src/core/core_utils.js b/src/core/core_utils.js index 9d1bf124a..694342fa9 100644 --- a/src/core/core_utils.js +++ b/src/core/core_utils.js @@ -95,7 +95,7 @@ const ROMAN_NUMBER_MAP = [ /** * Converts positive integers to (upper case) Roman numerals. - * @param {integer} number - The number that should be converted. + * @param {number} number - The number that should be converted. * @param {boolean} lowerCase - Indicates if the result should be converted * to lower case letters. The default value is `false`. * @return {string} The resulting Roman number. diff --git a/src/core/image.js b/src/core/image.js index 2e848b25c..e448695e6 100644 --- a/src/core/image.js +++ b/src/core/image.js @@ -49,11 +49,11 @@ var PDFImage = (function PDFImageClosure() { /** * Resizes an image mask with 1 component. * @param {TypedArray} src - The source buffer. - * @param {Number} bpc - Number of bits per component. - * @param {Number} w1 - Original width. - * @param {Number} h1 - Original height. - * @param {Number} w2 - New width. - * @param {Number} h2 - New height. + * @param {number} bpc - Number of bits per component. + * @param {number} w1 - Original width. + * @param {number} h1 - Original height. + * @param {number} w2 - New width. + * @param {number} h2 - New height. * @returns {TypedArray} The resized image mask buffer. */ function resizeImageMask(src, bpc, w1, h1, w2, h2) { diff --git a/web/ui_utils.js b/web/ui_utils.js index cb7108a75..941db2383 100644 --- a/web/ui_utils.js +++ b/web/ui_utils.js @@ -215,7 +215,7 @@ function parseQueryString(query) { * that if the condition is true for one item in the array, then it is also true * for all following items. * - * @returns {Number} Index of the first array element to pass the test, + * @returns {number} Index of the first array element to pass the test, * or |items.length| if no such element exists. */ function binarySearchFirstItem(items, condition) {