Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function initialize() {
const application = arguments[1] || arguments[0];
const { flashMessageDefaults } = config || {};
const { injectionFactories } = flashMessageDefaults || [];
const options = flashMessageOptions(flashMessageDefaults);
const shouldShowDeprecation = !(injectionFactories && injectionFactories.length);
deprecate(INJECTION_FACTORIES_DEPRECATION_MESSAGE, shouldShowDeprecation, {
id: 'ember-cli-flash.deprecate-injection-factories',
until: '2.0.0'
});
options.injectionFactories.forEach((factory) => {
application.inject(factory, 'flashMessages', 'service:flash-messages');
});
}