| 4134 | } |
| 4135 | |
| 4136 | public Object safeDict(Object dictionaryOrList, Object key, Object... optionalArgs) |
| 4137 | { |
| 4138 | /** |
| 4139 | * @ignore |
| 4140 | * @method |
| 4141 | * @description safely extract a dictionary from dictionary or list |
| 4142 | * @returns {object | undefined} |
| 4143 | */ |
| 4144 | Object defaultValue = Helpers.getArg(optionalArgs, 0, null); |
| 4145 | Object value = this.safeValue(dictionaryOrList, key, defaultValue); |
| 4146 | if (Helpers.isTrue(Helpers.isEqual(value, null))) |
| 4147 | { |
| 4148 | return defaultValue; |
| 4149 | } |
| 4150 | if (Helpers.isTrue(this.isDictionary(value))) |
| 4151 | { |
| 4152 | return value; |
| 4153 | } |
| 4154 | return defaultValue; |
| 4155 | } |
| 4156 | |
| 4157 | public Object safeDict2(Object dictionaryOrList, Object key1, Object key2, Object... optionalArgs) |
| 4158 | { |