Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
jimpInstance.encoders = {
...jimpInstance.encoders,
...jimpConfig.encoders
};
jimpInstance.hasAlpha = {
...jimpInstance.hasAlpha,
...jimpConfig.hasAlpha
};
}
if (configuration.plugins) {
configuration.plugins.forEach(addPlugin);
}
addJimpMethods(jimpConfig.class, jimpInstance);
addConstants(jimpConfig.constants, jimpInstance);
return Jimp;
}
};
jimpInstance.encoders = {
...jimpInstance.encoders,
...jimpConfig.encoders
};
jimpInstance.hasAlpha = {
...jimpInstance.hasAlpha,
...jimpConfig.hasAlpha
};
}
if (configuration.plugins) {
configuration.plugins.forEach(addPlugin);
}
addJimpMethods(jimpConfig.class, jimpInstance);
addConstants(jimpConfig.constants, jimpInstance);
return Jimp;
}
function addImageType(typeModule) {
const type = typeModule();
if (Array.isArray(type.mime)) {
addType(...type.mime);
} else {
Object.entries(type.mime).forEach(mimeType => addType(...mimeType));
}
delete type.mime;
addToConfig(type);
}