Skip to content

Commit

Permalink
corrected doc blocks and added a line to update options if null
Browse files Browse the repository at this point in the history
  • Loading branch information
allierowan committed May 16, 2017
1 parent eef6643 commit 945edf6
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ function heightAscThanNameComparator(a, b) {
* Pack a list of images with width and height into a sprite layout.
* options object with the following keys:
*
* @param {Object[]} imgs Array of `{ svg: Buffer, id: String }`
* @param {number} pixelRatio Ratio of a 72dpi screen pixel to the destination pixel density
* @param {boolean} format If true, generate {@link DataLayout}; if false, generate {@link ImgLayout}
* @param {Function} callback Accepts two arguments, `err` and `layout` Object
* @param {boolean} maxIconSize optional, overrides the max_size in mapnik
* @return {DataLayout|ImgLayout} layout Generated Layout Object with sprite contents
* @param {Object} [options]
* @param {Object[]} [options.imgs] Array of `{ svg: Buffer, id: String }`
* @param {number} [options.pixelRatio] Ratio of a 72dpi screen pixel to the destination pixel density
* @param {boolean} [options.format] If true, generate {@link DataLayout}; if false, generate {@link ImgLayout}
* @param {boolean} [options.maxIconSize] optional, overrides the max_size in mapnik
* @param {Function} callback Accepts two arguments, `err` and `layout` Object
* @return {DataLayout|ImgLayout} layout Generated Layout Object with sprite contents
*/
function generateLayout(options, callback) {
options = options || {};
options.unique = false;
return generateLayoutInternal(options, callback);
}
Expand All @@ -41,14 +43,16 @@ function generateLayout(options, callback) {
*
* options object with the following keys:
*
* @param {Object[]} imgs Array of `{ svg: Buffer, id: String }`
* @param {number} pixelRatio Ratio of a 72dpi screen pixel to the destination pixel density
* @param {boolean} format If true, generate {@link DataLayout}; if false, generate {@link ImgLayout}
* @param {Function} callback Accepts two arguments, `err` and `layout` Object
* @param {boolean} maxIconSize optional, overrides the max_size in mapnik
* @return {DataLayout|ImgLayout} layout Generated Layout Object with sprite contents
* @param {Object} [options]
* @param {Object[]} [options.imgs] Array of `{ svg: Buffer, id: String }`
* @param {number} [options.pixelRatio] Ratio of a 72dpi screen pixel to the destination pixel density
* @param {boolean} [options.format] If true, generate {@link DataLayout}; if false, generate {@link ImgLayout}
* @param {boolean} [options.maxIconSize] optional, overrides the max_size in mapnik
* @param {Function} callback Accepts two arguments, `err` and `layout` Object
* @return {DataLayout|ImgLayout} layout Generated Layout Object with sprite contents
*/
function generateLayoutUnique(options, callback) {
options = options || {};
options.unique = true;
return generateLayoutInternal(options, callback);
}
Expand Down

0 comments on commit 945edf6

Please sign in to comment.