Socket
Socket
Sign inDemoInstall

ssri

Package Overview
Dependencies
2
Maintainers
6
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 9.0.0 to 9.0.1

27

lib/index.js

@@ -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 @@ }

6

package.json
{
"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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc