shared-store
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -0,1 +1,9 @@ | ||
### 2.1.1 | ||
* stop emitting updates on HTTP 304s - **[@dbushong](https://github.com/dbushong)** [#30](https://github.com/groupon/shared-store/pull/30) | ||
- [`b5ea890`](https://github.com/groupon/shared-store/commit/b5ea890801b616759577eada2257e97786a6fdf8) **perf:** stop emitting updates on HTTP 304s | ||
- [`4d1a718`](https://github.com/groupon/shared-store/commit/4d1a7183d6fa96f1ff2c480cd37177a910e5d8b3) **chore:** update nlm & mocha; rebuild JS | ||
- [`9a8f23b`](https://github.com/groupon/shared-store/commit/9a8f23be74eb479cb5ad7faa7fe7a24481b542e3) **chore:** update coffeelint & make code pass | ||
### 2.1.0 | ||
@@ -2,0 +10,0 @@ |
@@ -34,3 +34,3 @@ | ||
'use strict'; | ||
var Observable, activeLoader, cleanup, crashRecovery, debug, dirContent, fromPromiseFunction, fs, identity, isCacheFile, isEqual, latestCacheFile, latestFile, mkdirp, mkdirpStream, partial, passiveLoader, path, promisify, property, readCacheFile, readFile, ref, sortByMostRecent, timestampName, tryCache, unlink, writeCache, writeFile; | ||
var Observable, activeLoader, cleanup, crashRecovery, debug, dirContent, fromPromiseFunction, fs, isCacheFile, isEqual, latestCacheFile, latestFile, mkdirp, mkdirpStream, partial, passiveLoader, path, promisify, property, readCacheFile, readFile, ref, sortByMostRecent, timestampName, tryCache, unlink, writeCache, writeFile; | ||
@@ -47,3 +47,3 @@ path = require('path'); | ||
ref = require('lodash'), identity = ref.identity, isEqual = ref.isEqual, property = ref.property, partial = ref.partial; | ||
ref = require('lodash'), isEqual = ref.isEqual, property = ref.property, partial = ref.partial; | ||
@@ -161,5 +161,5 @@ debug = require('debug')('shared-store:cache'); | ||
var data, fromCache, onDataLoaded, rawData, ref1, tearDownCrashHandler; | ||
rawData = meta.flatMapLatest(loader).map(function(data) { | ||
data.usingCache = false; | ||
return data; | ||
rawData = meta.flatMapLatest(loader).map(function(otherData) { | ||
otherData.usingCache = false; | ||
return otherData; | ||
}); | ||
@@ -166,0 +166,0 @@ ref1 = crashRecovery(tmpDir), onDataLoaded = ref1.onDataLoaded, tearDownCrashHandler = ref1.tearDownCrashHandler; |
@@ -49,3 +49,2 @@ | ||
files = (function() { | ||
var error; | ||
try { | ||
@@ -64,3 +63,3 @@ return fs.readdirSync(tmpDir); | ||
files.forEach(function(filename) { | ||
var absolute, error; | ||
var absolute; | ||
absolute = path.join(tmpDir, filename); | ||
@@ -67,0 +66,0 @@ try { |
@@ -34,3 +34,3 @@ | ||
'use strict'; | ||
var Observable, Promise, compose, debug, dirChanges, dirContent, extend, fromPromiseFunction, fs, niceStat, path, promisify, readdir, ref, stat; | ||
var Observable, debug, dirChanges, dirContent, extend, fromPromiseFunction, fs, niceStat, path, promisify, readdir, stat; | ||
@@ -43,5 +43,5 @@ path = require('path'); | ||
promisify = (Promise = require('bluebird')).promisify; | ||
promisify = require('bluebird').promisify; | ||
ref = require('lodash'), extend = ref.extend, compose = ref.compose; | ||
extend = require('lodash').extend; | ||
@@ -91,4 +91,4 @@ debug = require('debug')('shared-store:dir-content'); | ||
return niceStat(props, absolute).done(onNext, function(error) { | ||
var code, ref1; | ||
code = (ref1 = error.cause) != null ? ref1.code : void 0; | ||
var code, ref; | ||
code = (ref = error.cause) != null ? ref.code : void 0; | ||
debug('stat failed: %s', code, filename); | ||
@@ -104,6 +104,7 @@ if (code === 'ENOENT') { | ||
}); | ||
return dispose = function() { | ||
dispose = function() { | ||
debug('Closing watcher: %s', dir); | ||
return watcher.close(); | ||
}; | ||
return dispose; | ||
}); | ||
@@ -113,4 +114,4 @@ }; | ||
dirContent = function(dir, arg) { | ||
var initial, ref1, statDir, statFiles, watch; | ||
ref1 = arg != null ? arg : {}, watch = ref1.watch, statFiles = ref1.statFiles; | ||
var initial, ref, statDir, statFiles, watch; | ||
ref = arg != null ? arg : {}, watch = ref.watch, statFiles = ref.statFiles; | ||
if (statFiles == null) { | ||
@@ -117,0 +118,0 @@ statFiles = false; |
@@ -34,3 +34,3 @@ | ||
'use strict'; | ||
var CSON, Promise, debug, dirChanges, fileChanges, fileContent, fromPromiseFunction, fs, identity, isMissingError, onInterval, parseCSON, parseJSON, parserFromExtension, partial, path, promisify, readFile, ref; | ||
var Bluebird, CSON, debug, dirChanges, fileChanges, fileContent, fromPromiseFunction, fs, identity, isMissingError, onInterval, parseCSON, parseJSON, parserFromExtension, partial, path, promisify, readFile, ref; | ||
@@ -41,3 +41,3 @@ fs = require('fs'); | ||
promisify = (Promise = require('bluebird')).promisify; | ||
promisify = (Bluebird = require('bluebird')).promisify; | ||
@@ -71,3 +71,3 @@ ref = require('lodash'), partial = ref.partial, identity = ref.identity; | ||
parseCSON = function(filename, content) { | ||
var err, error1; | ||
var err; | ||
try { | ||
@@ -83,3 +83,3 @@ return CSON.parse(content); | ||
parseJSON = function(filename, content) { | ||
var err, error1; | ||
var err; | ||
try { | ||
@@ -106,9 +106,9 @@ return JSON.parse(content); | ||
fileContent = function(filename, options) { | ||
var defaultValue, hasDefault, interval, load, loaded, parse, returnDefault, root, watch, wrap; | ||
var defaultValue, hasDefault, interval, load, loaded, parse, returnDefault, rootDir, watch, wrap; | ||
if (options == null) { | ||
options = {}; | ||
} | ||
defaultValue = options.defaultValue, watch = options.watch, interval = options.interval, parse = options.parse, root = options.root; | ||
if (root != null) { | ||
filename = path.resolve(root, filename); | ||
defaultValue = options.defaultValue, watch = options.watch, interval = options.interval, parse = options.parse, rootDir = options.root; | ||
if (rootDir != null) { | ||
filename = path.resolve(rootDir, filename); | ||
} | ||
@@ -124,3 +124,3 @@ if (parse == null) { | ||
} else { | ||
return Promise.reject(error); | ||
return Bluebird.reject(error); | ||
} | ||
@@ -127,0 +127,0 @@ }; |
@@ -34,5 +34,5 @@ | ||
'use strict'; | ||
var Promise, debug, fromPromiseFunction, httpResource, onInterval, partial; | ||
var Bluebird, debug, fromPromiseFunction, httpResource, onInterval, partial; | ||
Promise = require('bluebird'); | ||
Bluebird = require('bluebird'); | ||
@@ -82,3 +82,3 @@ debug = require('debug')('shared-store:http'); | ||
} else { | ||
return Promise.reject(error); | ||
return Bluebird.reject(error); | ||
} | ||
@@ -92,5 +92,7 @@ }; | ||
}); | ||
return onInterval(interval, load); | ||
return onInterval(interval, load).distinctUntilChanged(null, function(a, b) { | ||
return a === b; | ||
}); | ||
}; | ||
module.exports = httpResource; |
@@ -34,6 +34,4 @@ | ||
'use strict'; | ||
var Observable, dirChanges, dirContent, getLatestFileInfo, getMTime, latestFile, mostRecent, onInterval, path; | ||
var Observable, dirChanges, dirContent, getLatestFileInfo, getMTime, latestFile, mostRecent, onInterval; | ||
path = require('path'); | ||
Observable = require('rx').Observable; | ||
@@ -40,0 +38,0 @@ |
@@ -34,10 +34,10 @@ | ||
'use strict'; | ||
var Observable, Promise, config, fromPromiseFunction, ref; | ||
var Bluebird, Observable, config, fromPromiseFunction, ref; | ||
ref = require('rx'), Observable = ref.Observable, config = ref.config; | ||
Promise = require('bluebird'); | ||
Bluebird = require('bluebird'); | ||
if (config.Promise == null) { | ||
config.Promise = Promise; | ||
config.Promise = Bluebird; | ||
} | ||
@@ -48,3 +48,3 @@ | ||
var onRejected, onResolved, p; | ||
p = Promise["try"](fn); | ||
p = Bluebird["try"](fn); | ||
onResolved = function(value) { | ||
@@ -51,0 +51,0 @@ observer.onNext(value); |
@@ -34,3 +34,3 @@ | ||
'use strict'; | ||
var EventEmitter, Observable, Promise, RETRY_MULTIPLIER, SharedStore, TEN_MINUTES, TEN_SECONDS, cachedLoader, cluster, freeze, latestCacheFile, path, property, ref, safeMerge, | ||
var Bluebird, EventEmitter, Observable, RETRY_MULTIPLIER, SharedStore, TEN_MINUTES, TEN_SECONDS, cachedLoader, cluster, freeze, latestCacheFile, path, ref, safeMerge, | ||
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, | ||
@@ -48,8 +48,6 @@ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, | ||
Promise = require('bluebird'); | ||
Bluebird = require('bluebird'); | ||
freeze = require('deep-freeze'); | ||
property = require('lodash').property; | ||
ref = require('./cache'), cachedLoader = ref.cachedLoader, latestCacheFile = ref.latestCacheFile; | ||
@@ -118,3 +116,3 @@ | ||
} | ||
result = new Promise((function(_this) { | ||
result = new Bluebird((function(_this) { | ||
return function(resolve, reject) { | ||
@@ -121,0 +119,0 @@ var handleData, handleErr; |
{ | ||
"name": "shared-store", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Keeping config data in sync", | ||
@@ -17,2 +17,3 @@ "license": "BSD-3-Clause", | ||
"build": "rm -rf lib && coffee --no-header -cbo lib src", | ||
"lint": "coffeelint src test", | ||
"pretest": "npm run build", | ||
@@ -40,7 +41,12 @@ "test": "mocha", | ||
"devDependencies": { | ||
"assertive": "^2.0.0", | ||
"assertive": "^2.1.0", | ||
"coffee-script": "^1.10.0", | ||
"coffeelint": "^1.9.2", | ||
"mocha": "^2.0.0", | ||
"nlm": "^2.0.0", | ||
"coffeelint": "~1.16.0", | ||
"coffeelint-config-groupon": "^3.2.0", | ||
"coffeelint-forbidden-keywords": "~0.1.1", | ||
"coffeelint-no-mocha-only": "^1.0.0", | ||
"coffeelint-use-strict": "^1.0.0", | ||
"coffeescope2": "^0.4.3", | ||
"mocha": "^3.1.2", | ||
"nlm": "^3.0.0", | ||
"nodemon": "^1.0.0", | ||
@@ -47,0 +53,0 @@ "rimraf": "^2.2.8", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54095
13