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

ramp-resources

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ramp-resources - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

53

lib/resource-set.js

@@ -42,2 +42,40 @@ var _ = require("lodash");

function partition(n, xs) {
if (n === 0) {
throw new Error("n must be > 0")
}
var numFullGroups = Math.floor(xs.length / n);
if (numFullGroups === 0) {
return [xs];
}
var res = [];
for (var i = 0; i < numFullGroups; i++) {
res.push(xs.slice(i * n, ((i + 1) * n)));
}
var tail = xs.slice(numFullGroups * n);
if (tail.length > 0) {
res.push(tail);
}
return res;
}
function whenSequenceConcatIter(promises, deferred, result) {
if (promises.length === 0) {
deferred.resolve(result);
} else {
promises[0]().then(function (xs) {
whenSequenceConcatIter(promises.slice(1), deferred, result.concat(xs));
}, deferred.reject);
}
}
function whenSequenceConcat(promises) {
var deferred = when.defer();
whenSequenceConcatIter(promises, deferred, []);
return deferred.promise;
};
/**

@@ -343,3 +381,8 @@ * Create new resource set, resolved from the provided rootPath,

var s = serialize.bind(null, cached);
when.all(this.map(s)).then(function (resources) {
var groupedResources = partition(100, Array.prototype.slice.call(this));
whenSequenceConcat(groupedResources.map(function (resources) {
return function () {
return when.all(resources.map(s));
}
})).then(function (resources) {
d.resolver.resolve({

@@ -482,6 +525,10 @@ resources: resources,

when.all(promises).then(function () {
rs.loadPath.append(data.loadPath || []);
d.resolver.resolve(rs);
try {
rs.loadPath.append(data.loadPath || []);
d.resolver.resolve(rs);
} catch (e) {
d.reject(e.message);
}
}, d.reject);
return d.promise;
};

2

package.json
{
"name": "ramp-resources",
"version": "1.0.4",
"version": "1.0.5",
"description": "Virtual file systems for exposing files and other resources on e.g. web servers",

@@ -5,0 +5,0 @@ "homepage": "http://busterjs.org/docs/resources",

@@ -13,2 +13,6 @@ #ramp-resources

**1.0.5** (08.08.2014)
* fix for issue [#347 - Failed creating session: EMFILE, open 'some/file/path.js'](https://github.com/busterjs/buster/issues/347)
**1.0.4** (12.05.2014)

@@ -15,0 +19,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