Skip to content

Commit

Permalink
✨ Make Function.getDescendant(name) also try the lowercase version …
Browse files Browse the repository at this point in the history
…of the name
  • Loading branch information
skerit committed Mar 11, 2024
1 parent 07130bb commit 352e9d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 2 additions & 2 deletions lib/function_inheritance.js
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ defClassMethod(function getDescendantsDict(constructor) {
*
* @author Jelle De Loecker <[email protected]>
* @since 0.7.26
* @version 0.9.0
* @version 0.9.3
*/
defClassMethod(function getDescendant(constructor, name) {

Expand All @@ -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('.');
Expand Down

0 comments on commit 352e9d6

Please sign in to comment.