Implement a simple DI container:
const container = new Container();
container.register('name', factoryExpr, deps?)
container.resolve('name') // instantiate with resolved depsregister(name, factoryExpr, deps) — register a factory **expression string** (e.g. '() => 42' or '(x) => x * 2') with optional dependency
names. Convert it to a function via new Function('return ' + expr)().
resolve(name) — resolve the service, auto-resolving its dependenciesrecursively. Throw on circular deps or missing registrations.
solve(registrations, target) replays registrations then resolves a service.
Each registration is a tuple [name, factoryExpr, deps?].
Sample tests