* Gets the name in upper case of the consistency level. * @param {Number} consistency * @private
(consistency)
| 179 | * @private |
| 180 | */ |
| 181 | function getConsistencyName(consistency) { |
| 182 | // eslint-disable-next-line |
| 183 | if (consistency == undefined) { |
| 184 | //null or undefined => undefined |
| 185 | return undefined; |
| 186 | } |
| 187 | loadConsistencyNames(); |
| 188 | const name = consistencyNames[consistency]; |
| 189 | if (!name) { |
| 190 | throw new Error(util.format( |
| 191 | 'Consistency %s not found, use values defined as properties in types.consistencies object', consistency |
| 192 | )); |
| 193 | } |
| 194 | return name; |
| 195 | } |
| 196 | |
| 197 | function loadConsistencyNames() { |
| 198 | if (consistencyNames) { |
no test coverage detected