Skip to content

Commit 6d13165

Browse files
committed
Use native promises only
BREAKING CHANGE: ssri no longer accepts a Promise option, and does not use, return, or rely on Bluebird promises.
1 parent f7224bc commit 6d13165

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

index.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const SsriOpts = figgyPudding({
1717
integrity: {},
1818
options: { default: [] },
1919
pickAlgorithm: { default: () => getPrioritizedHash },
20-
Promise: { default: () => Promise },
2120
sep: { default: ' ' },
2221
single: { default: false },
2322
size: {},
@@ -299,9 +298,8 @@ function fromData (data, opts) {
299298
module.exports.fromStream = fromStream
300299
function fromStream (stream, opts) {
301300
opts = SsriOpts(opts)
302-
const P = opts.Promise || Promise
303301
const istream = integrityStream(opts)
304-
return new P((resolve, reject) => {
302+
return new Promise((resolve, reject) => {
305303
stream.pipe(istream)
306304
stream.on('error', reject)
307305
istream.on('error', reject)
@@ -354,11 +352,10 @@ function checkData (data, sri, opts) {
354352
module.exports.checkStream = checkStream
355353
function checkStream (stream, sri, opts) {
356354
opts = SsriOpts(opts)
357-
const P = opts.Promise || Promise
358355
const checker = integrityStream(opts.concat({
359356
integrity: sri
360357
}))
361-
return new P((resolve, reject) => {
358+
return new Promise((resolve, reject) => {
362359
stream.pipe(checker)
363360
stream.on('error', reject)
364361
checker.on('error', reject)

0 commit comments

Comments
 (0)