Comparing version 4.1.0 to 4.1.1
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="4.1.1"></a> | ||
## [4.1.1](https://github.com/zkat/ssri/compare/v4.1.0...v4.1.1) (2017-04-12) | ||
### Bug Fixes | ||
* **pickAlgorithm:** error if pickAlgorithm() is used in an empty Integrity ([fab470e](https://github.com/zkat/ssri/commit/fab470e)) | ||
<a name="4.1.0"></a> | ||
@@ -7,0 +17,0 @@ # [4.1.0](https://github.com/zkat/ssri/compare/v4.0.0...v4.1.0) (2017-04-07) |
@@ -96,3 +96,7 @@ 'use strict' | ||
const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash | ||
return Object.keys(this).reduce((acc, algo) => { | ||
const keys = Object.keys(this) | ||
if (!keys.length) { | ||
throw new Error(`No algorithms available for ${this}`) | ||
} | ||
return keys.reduce((acc, algo) => { | ||
return pickAlgorithm(acc, algo) || acc | ||
@@ -99,0 +103,0 @@ }) |
{ | ||
"name": "ssri", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.", | ||
@@ -41,6 +41,6 @@ "main": "index.js", | ||
"devDependencies": { | ||
"nyc": "^10.0.0", | ||
"standard": "^9.0.1", | ||
"nyc": "^10.2.0", | ||
"standard": "^9.0.2", | ||
"standard-version": "^4.0.0", | ||
"tap": "^10.3.0", | ||
"tap": "^10.3.2", | ||
"weallbehave": "^1.0.0", | ||
@@ -47,0 +47,0 @@ "weallcontribute": "^1.0.8" |
34368
314