diff --git a/CHANGELOG.md b/CHANGELOG.md index 241cbf7..25fcec0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.9.3 (WIP) * Add `Trail#ifNull(fallback)` method +* Make `Function.getDescendant(name)` also try the lowercase version of the name ## 0.9.2 (2024-02-25) diff --git a/lib/function_inheritance.js b/lib/function_inheritance.js index dcaf716..9ea3393 100644 --- a/lib/function_inheritance.js +++ b/lib/function_inheritance.js @@ -1075,7 +1075,7 @@ defClassMethod(function getDescendantsDict(constructor) { * * @author Jelle De Loecker * @since 0.7.26 - * @version 0.9.0 + * @version 0.9.3 */ defClassMethod(function getDescendant(constructor, name) { @@ -1085,7 +1085,7 @@ defClassMethod(function getDescendant(constructor, name) { const dict = constructor.getDescendantsDict(); - let result = dict[name]; + let result = dict[name] || dict[name.toLowerCase()]; if (!result) { name = Blast.parseClassPath(name).map(entry => Bound.String.underscore(entry)).join('.');