| 4096 | } |
| 4097 | |
| 4098 | public Object safeBool(Object dictionaryOrList, Object key, Object... optionalArgs) |
| 4099 | { |
| 4100 | /** |
| 4101 | * @ignore |
| 4102 | * @method |
| 4103 | * @description safely extract boolean value from dictionary or list |
| 4104 | * @returns {bool | undefined} |
| 4105 | */ |
| 4106 | Object defaultValue = Helpers.getArg(optionalArgs, 0, null); |
| 4107 | Object value = this.safeValue(dictionaryOrList, key, defaultValue); |
| 4108 | if (Helpers.isTrue((value instanceof Boolean))) |
| 4109 | { |
| 4110 | return value; |
| 4111 | } |
| 4112 | return defaultValue; |
| 4113 | } |
| 4114 | |
| 4115 | public Object safeDictN(Object dictionaryOrList, Object keys, Object... optionalArgs) |
| 4116 | { |