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 merge(container1: Container, container2: Container): Container {
const container = new Container();
const bindingDictionary: interfaces.Lookup> = getBindingDictionary(container);
const bindingDictionary1: interfaces.Lookup> = getBindingDictionary(container1);
const bindingDictionary2: interfaces.Lookup> = getBindingDictionary(container2);
function copyDictionary(origin: interfaces.Lookup>,
destination: interfaces.Lookup>) {
origin.traverse((key, value) => {
value.forEach((binding) => {
destination.add(binding.serviceIdentifier, binding);
});
});
}
copyDictionary(bindingDictionary1, bindingDictionary);
copyDictionary(bindingDictionary2, bindingDictionary);
return container;
export function merge(container1: Container, container2: Container): Container {
const container = new Container();
const bindingDictionary: interfaces.Lookup> = getBindingDictionary(container);
const bindingDictionary1: interfaces.Lookup> = getBindingDictionary(container1);
const bindingDictionary2: interfaces.Lookup> = getBindingDictionary(container2);
function copyDictionary(origin: interfaces.Lookup>,
destination: interfaces.Lookup>) {
origin.traverse((key, value) => {
value.forEach((binding) => {
destination.add(binding.serviceIdentifier, binding);
});
});
}
copyDictionary(bindingDictionary1, bindingDictionary);
copyDictionary(bindingDictionary2, bindingDictionary);
return container;
}
export function merge(container1: Container, container2: Container): Container {
const container = new Container();
const bindingDictionary: interfaces.Lookup> = getBindingDictionary(container);
const bindingDictionary1: interfaces.Lookup> = getBindingDictionary(container1);
const bindingDictionary2: interfaces.Lookup> = getBindingDictionary(container2);
function copyDictionary(origin: interfaces.Lookup>,
destination: interfaces.Lookup>) {
origin.traverse((key, value) => {
value.forEach((binding) => {
destination.add(binding.serviceIdentifier, binding);
});
});
}
copyDictionary(bindingDictionary1, bindingDictionary);
copyDictionary(bindingDictionary2, bindingDictionary);
return container;
}