Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pull-git-repo

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-git-repo - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

35

index.js

@@ -938,1 +938,36 @@ var buffered = require('pull-buffered')

}
function callWithTimeout(fn, timeout, cb) {
var timer = setTimeout(function () {
timer = null
cb(true)
cb = function () {}
}, timeout)
fn.call(this, function () {
clearTimeout(timer)
cb.apply(this, arguments)
})
}
R.getFirstAvailableRev = function (timeout, cb) {
var self = this
var lastErr = null
return function (readRev) {
readRev(null, function next(err, rev) {
if (err === true) return cb(lastErr)
if (err) return cb(err)
callWithTimeout(function (cb) {
self.getObjectFromAny(rev, cb)
}, timeout, function (err, obj) {
if (!err && obj) {
readRev(true, function (err) {
cb(err === true ? null : err, rev)
})
} else {
lastErr = err
readRev(null, next)
}
})
})
}
}

2

package.json
{
"name": "pull-git-repo",
"version": "0.6.1",
"version": "0.6.2",
"description": "utility methods for git repos using pull streams",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -198,2 +198,10 @@ # pull-git-repo

#### `repo.getFirstAvailableRev(timeout, cb): sink(rev)`
Pull revs into this sink, and it will try to retrieve them, and callback the
first one that resolves within the given timeout.
- `timeout`: milliseconds to wait for a rev before giving up on it
- `rev`: hash of an object to try to retrieve
## License

@@ -200,0 +208,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc