-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1734,15 +1734,61 @@ const MagicGroupValue = Function.inherits('Magic', 'Alchemy.Setting', function M | |
*/ | ||
MagicGroupValue.setMethod(function __get(key) { | ||
|
||
let result = this[VALUE].get(key); | ||
let result = this[key]; | ||
|
||
if (result != null) { | ||
return result; | ||
} | ||
|
||
result = this[VALUE].get(key); | ||
|
||
if (result == null) { | ||
return this[VALUE][key]; | ||
} | ||
|
||
if (!result) { | ||
return; | ||
return result; | ||
} | ||
|
||
if (result.is_group) { | ||
return result.toProxyObject(); | ||
} | ||
|
||
if (!result.get) { | ||
return result; | ||
} | ||
|
||
return result.get(); | ||
}); | ||
|
||
/** | ||
* The magic getter | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
* @version 1.4.0 | ||
* | ||
* @param {string} key | ||
*/ | ||
MagicGroupValue.setMethod(function __ownKeys() { | ||
return Object.keys(this[VALUE].toObject()) | ||
}); | ||
|
||
/** | ||
* The magic getter | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 1.4.0 | ||
* @version 1.4.0 | ||
* | ||
* @param {string} key | ||
*/ | ||
MagicGroupValue.setMethod(function __describe(key) { | ||
let result = Object.getOwnPropertyDescriptor(this[VALUE], key); | ||
|
||
if (result == null) { | ||
result = Object.getOwnPropertyDescriptor(this, key); | ||
} | ||
|
||
return result; | ||
}); |