git ssb

0+

cel / ssb-exec



Commit fb32aba68ca6fa8bb5c6aa03f81d9f3cc71a50d4

indent

cel committed on 2/5/2019, 8:57:16 AM
Parent: 06f263c1100b77af62177e4b11348b6b4574caae

Files changed

index.jschanged
index.jsView
@@ -27,21 +27,19 @@
2727 try {
2828 var module = require(resolved)
2929 return cb(null, module)
3030 } catch(e) {
31- if (!tried && e && (e.code === 'ENOENT' || e.code === 'MODULE_NOT_FOUND')) {
32- var m = /(sha256)\/([0-9a-f]{2})\/([0-9a-f]{62})/.exec(e.path || e.message)
33- if (!m) return cb(e)
34- var blobId = '&' + new Buffer(m[2] + m[3], 'hex').toString('base64') + '.' + m[1]
35- if (!sbot.blobs) return cb(new Error('Missing ssb-blobs plugin'))
36- if (typeof sbot.blobs.want !== 'function') return cb(new Error('missing blobs.want method'))
37- return sbot.blobs.want(blobId, function (err, has) {
38- if (err) return cb(new Error('Unable to get blob: ' + (err.stack || err)))
39- if (!has) return cb(new Error('Unable to get blob'))
40- getModule(resolved, true, cb)
41- })
42- }
43- return cb(e)
31 + if (tried || !e || !(e.code === 'ENOENT' || e.code === 'MODULE_NOT_FOUND')) return cb(e)
32 + var m = /(sha256)\/([0-9a-f]{2})\/([0-9a-f]{62})/.exec(e.path || e.message)
33 + if (!m) return cb(e)
34 + var blobId = '&' + new Buffer(m[2] + m[3], 'hex').toString('base64') + '.' + m[1]
35 + if (!sbot.blobs) return cb(new Error('Missing ssb-blobs plugin'))
36 + if (typeof sbot.blobs.want !== 'function') return cb(new Error('missing blobs.want method'))
37 + return sbot.blobs.want(blobId, function (err, has) {
38 + if (err) return cb(new Error('Unable to get blob: ' + (err.stack || err)))
39 + if (!has) return cb(new Error('Unable to get blob'))
40 + getModule(resolved, true, cb)
41 + })
4442 }
4543 }
4644
4745 sbot.ws.use(function (req, res, next) {

Built with git-ssb-web