Comparing version 9.0.0 to 9.0.1
@@ -33,2 +33,6 @@ 'use strict' | ||
const _getOptions = Symbol('_getOptions') | ||
const _emittedSize = Symbol('_emittedSize') | ||
const _emittedIntegrity = Symbol('_emittedIntegrity') | ||
const _emittedVerified = Symbol('_emittedVerified') | ||
class IntegrityStream extends MiniPass { | ||
@@ -67,2 +71,18 @@ constructor (opts) { | ||
on (ev, handler) { | ||
if (ev === 'size' && this[_emittedSize]) { | ||
return handler(this[_emittedSize]) | ||
} | ||
if (ev === 'integrity' && this[_emittedIntegrity]) { | ||
return handler(this[_emittedIntegrity]) | ||
} | ||
if (ev === 'verified' && this[_emittedVerified]) { | ||
return handler(this[_emittedVerified]) | ||
} | ||
return super.on(ev, handler) | ||
} | ||
emit (ev, data) { | ||
@@ -108,5 +128,10 @@ if (ev === 'end') { | ||
} else { | ||
this[_emittedSize] = this.size | ||
this.emit('size', this.size) | ||
this[_emittedIntegrity] = newSri | ||
this.emit('integrity', newSri) | ||
match && this.emit('verified', match) | ||
if (match) { | ||
this[_emittedVerified] = match | ||
this.emit('verified', match) | ||
} | ||
} | ||
@@ -113,0 +138,0 @@ } |
{ | ||
"name": "ssri", | ||
"version": "9.0.0", | ||
"version": "9.0.1", | ||
"description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.", | ||
@@ -53,3 +53,3 @@ "main": "lib/index.js", | ||
"@npmcli/eslint-config": "^3.0.1", | ||
"@npmcli/template-oss": "3.2.2", | ||
"@npmcli/template-oss": "3.5.0", | ||
"tap": "^16.0.1" | ||
@@ -62,4 +62,4 @@ }, | ||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", | ||
"version": "3.2.2" | ||
"version": "3.5.0" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
37511
472
0