| 4155 | } |
| 4156 | |
| 4157 | public Object safeDict2(Object dictionaryOrList, Object key1, Object key2, Object... optionalArgs) |
| 4158 | { |
| 4159 | /** |
| 4160 | * @ignore |
| 4161 | * @method |
| 4162 | * @description safely extract a dictionary from dictionary or list |
| 4163 | * @returns {object | undefined} |
| 4164 | */ |
| 4165 | Object defaultValue = Helpers.getArg(optionalArgs, 0, null); |
| 4166 | Object value = this.safeValue(dictionaryOrList, key1); |
| 4167 | if (Helpers.isTrue(this.isDictionary(value))) |
| 4168 | { |
| 4169 | return value; |
| 4170 | } |
| 4171 | Object value2 = this.safeValue(dictionaryOrList, key2); |
| 4172 | if (Helpers.isTrue(this.isDictionary(value2))) |
| 4173 | { |
| 4174 | return value2; |
| 4175 | } |
| 4176 | return defaultValue; |
| 4177 | } |
| 4178 | |
| 4179 | public Object safeListN(Object dictionaryOrList, Object keys, Object... optionalArgs) |
| 4180 | { |