cloudinary-microurl
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "cloudinary-microurl", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A tiny library to generate cloudinary URLs from options objects", | ||
@@ -5,0 +5,0 @@ "main": "url.js", |
12
url.js
@@ -13,3 +13,3 @@ // Example options: | ||
const TYPES = [ | ||
var TYPES = [ | ||
{name: 'crop', prefix:'c'}, | ||
@@ -29,7 +29,7 @@ {name: 'effect', prefix:'e'}, | ||
const scheme = options.secure ? 'https' : 'http'; | ||
const cloud_name = options.cloud_name; | ||
var scheme = options.secure ? 'https' : 'http'; | ||
var cloud_name = options.cloud_name; | ||
if (!cloud_name) throw Error('Missing required options.cloud_name'); | ||
const params = []; | ||
var params = []; | ||
@@ -41,3 +41,3 @@ for (var i = 0; i < TYPES.length; i++) { | ||
if (Array.isArray(options[name])) { | ||
options[name].forEach(opt => params.push(prefix + '_' + opt)); | ||
options[name].forEach(function(opt) {params.push(prefix + '_' + opt)}); | ||
} else if (options[name] != null) { | ||
@@ -48,3 +48,3 @@ params.push(prefix + '_' + options[name]); | ||
const urlParams = params.length ? params.join(',') + '/' : ''; | ||
var urlParams = params.length ? params.join(',') + '/' : ''; | ||
return scheme + '://res.cloudinary.com/' | ||
@@ -51,0 +51,0 @@ + encodeURIComponent(options.cloud_name) |
3444