@adonisjs/fold
Advanced tools
Comparing version 9.9.3-1 to 9.9.3-2
@@ -26,6 +26,16 @@ import { inspect } from 'node:util'; | ||
if (parent) { | ||
return createError(`Cannot inject "${inspect(binding)}" in "[class: ${parent.name}]". The value cannot be constructed`); | ||
const error = createError(`Cannot inject "${inspect(binding)}" in "[class ${parent.name}]"`); | ||
error.help = 'The value is not a valid class'; | ||
return error; | ||
} | ||
return createError(`Cannot construct value "${inspect(binding)}" using container`); | ||
} | ||
#missingDependenciesException(parent, binding, createError) { | ||
if (parent) { | ||
const error = createError(`Cannot inject "[class ${binding.name}]" in "[class ${parent.name}]"`); | ||
error.help = `Container is not able to resolve "${parent.name}" class dependencies`; | ||
return error; | ||
} | ||
return createError(`Cannot construct "[class ${binding.name}]" class. Container is not able to resolve its dependencies`); | ||
} | ||
#getBindingProvider(binding) { | ||
@@ -142,3 +152,3 @@ return binding.containerProvider; | ||
if (dependencies.length < classConstructor.length) { | ||
throw createError(`Cannot construct "${binding.name}" class. Container is not able to resolve its dependencies`); | ||
throw this.#missingDependenciesException(parent, binding, createError); | ||
} | ||
@@ -145,0 +155,0 @@ const value = new binding(...dependencies); |
{ | ||
"name": "@adonisjs/fold", | ||
"version": "9.9.3-1", | ||
"version": "9.9.3-2", | ||
"description": "A simple and straight forward implementation for IoC container in JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63237
787