(opts)
| 26316 | ) || false |
| 26317 | } |
| 26318 | pickAlgorithm (opts) { |
| 26319 | const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash |
| 26320 | const keys = Object.keys(this) |
| 26321 | if (!keys.length) { |
| 26322 | throw new Error(`No algorithms available for ${ |
| 26323 | JSON.stringify(this.toString()) |
| 26324 | }`) |
| 26325 | } |
| 26326 | return keys.reduce((acc, algo) => { |
| 26327 | return pickAlgorithm(acc, algo) || acc |
| 26328 | }) |
| 26329 | } |
| 26330 | } |
| 26331 | |
| 26332 | module.exports.parse = parse |
no test coverage detected