Skip to content

Commit

Permalink
Use native promises only
Browse files Browse the repository at this point in the history
BREAKING CHANGE: ssri no longer accepts a Promise option, and does not
use, return, or rely on Bluebird promises.
  • Loading branch information
isaacs committed Sep 18, 2019
1 parent f7224bc commit 6d13165
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions index.js
Expand Up @@ -17,7 +17,6 @@ const SsriOpts = figgyPudding({
integrity: {},
options: { default: [] },
pickAlgorithm: { default: () => getPrioritizedHash },
Promise: { default: () => Promise },
sep: { default: ' ' },
single: { default: false },
size: {},
Expand Down Expand Up @@ -299,9 +298,8 @@ function fromData (data, opts) {
module.exports.fromStream = fromStream
function fromStream (stream, opts) {
opts = SsriOpts(opts)
const P = opts.Promise || Promise
const istream = integrityStream(opts)
return new P((resolve, reject) => {
return new Promise((resolve, reject) => {
stream.pipe(istream)
stream.on('error', reject)
istream.on('error', reject)
Expand Down Expand Up @@ -354,11 +352,10 @@ function checkData (data, sri, opts) {
module.exports.checkStream = checkStream
function checkStream (stream, sri, opts) {
opts = SsriOpts(opts)
const P = opts.Promise || Promise
const checker = integrityStream(opts.concat({
integrity: sri
}))
return new P((resolve, reject) => {
return new Promise((resolve, reject) => {
stream.pipe(checker)
stream.on('error', reject)
checker.on('error', reject)
Expand Down

0 comments on commit 6d13165

Please sign in to comment.