Permalink
Browse files

support default variant

  • Loading branch information...
1 parent 1317f2b commit 338fca409b49c367a0917b68f1188595b4e85ba0 @madhums committed Aug 9, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/imager.js
View
@@ -39,6 +39,9 @@ Imager.prototype.upload = function (files, callback, variant) {
if (typeof variant !== 'string' && !this.config.variants.default)
throw new Error('Please specify a proper variant OR provide a default variant in your imager config')
+ if (!variant && this.config.variants.default)
+ var variant = 'default'
+
if (typeof variant === 'string' && !this.config.variants[variant])
throw new Error('Please provide a variant which you have specified in the config file')

0 comments on commit 338fca4

Please sign in to comment.