@cloudinary/url-gen
Version:
Cloudinary URL-Gen SDK ========================= [](https://app.travis-ci.com/github/cloudinary/js-url-gen) ## About The Cloudinary URL-Gen SDK allows you to quickly and eas
40 lines (37 loc) • 949 B
JavaScript
;
/**
*
* @private
* @param {any} a
*/
function isObject(a) {
if (typeof a !== 'object' || a instanceof Array) {
return false;
}
else {
return true;
}
}
var Config = /** @class */ (function () {
function Config() {
}
Config.prototype.filterOutNonSupportedKeys = function (userProvidedConfig, validKeys) {
var obj = Object.create({});
if (isObject(userProvidedConfig)) {
Object.keys(userProvidedConfig).forEach(function (key) {
if (validKeys.indexOf(key) >= 0) {
obj[key] = userProvidedConfig[key];
}
else {
console.warn('Warning - unsupported key provided to configuration: ', key);
}
});
return obj;
}
else {
return Object.create({});
}
};
return Config;
}());
module.exports = Config;