New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

broccoli-caching-writer

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-caching-writer - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

21

index.js
var fs = require('fs');
var path = require('path');
var RSVP = require('rsvp');
var mkdirp = require('mkdirp')

@@ -40,10 +41,18 @@ var walkSync = require('walk-sync');

if (inputTreeHash !== self._cacheHash) {
self.updateCache(srcDir, self.getCleanCacheDir());
return RSVP.resolve()
.then(function() {
var updateCacheResult;
self._cacheHash = inputTreeHash;
self._cacheTreeKeys = inputTreeKeys;
}
if (inputTreeHash !== self._cacheHash) {
updateCacheResult = self.updateCache(srcDir, self.getCleanCacheDir());
linkFromCache(self.getCacheDir(), destDir);
self._cacheHash = inputTreeHash;
self._cacheTreeKeys = inputTreeKeys;
}
return updateCacheResult;
})
.finally(function() {
linkFromCache(self.getCacheDir(), destDir);
});
})

@@ -50,0 +59,0 @@ };

{
"name": "broccoli-caching-writer",
"version": "0.3.0",
"version": "0.3.1",
"description": "Broccoli plugin that allows simple caching (while still allowing N:N) based on the input tree hash.",

@@ -24,3 +24,4 @@ "main": "index.js",

"quick-temp": "~0.1.2",
"walk-sync": "~0.1.2"
"walk-sync": "~0.1.2",
"rsvp": "~3.0.6"
},

@@ -32,5 +33,4 @@ "devDependencies": {

"expect.js": "~0.3.1",
"mkdirp": "~0.4.0",
"rsvp": "~3.0.6"
"mkdirp": "~0.4.0"
}
}

@@ -9,2 +9,4 @@ # Broccoli Caching Writer

If you would prefer to preform your plugins work in a non-synchronous way, simply return a promise from `updateCache`.
## ZOMG!!! TESTS?!?!!?

@@ -11,0 +13,0 @@

@@ -125,3 +125,20 @@ 'use strict';

});
it('can return a promise that is resolved', function(){
var thenCalled = false;
var tree = cachingWriter(sourcePath, {
updateCache: function(srcDir, destDir) {
return {then: function(callback) {
thenCalled = true;
callback();
}};
}
});
builder = new broccoli.Builder(tree);
return builder.build().then(function(dir) {
expect(thenCalled).to.be.ok();
});
});
});
});
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