Comparing version 0.1.2 to 1.0.0
{ | ||
"name": "asc", | ||
"description": "A middleware layer between a service and a client. The service could be an in-process library, a file, an external web service, anything. Any time the results from a resource call can be cached, you can use ASC as a proxy to that resource.", | ||
"version": "0.1.2", | ||
"version": "1.0.0", | ||
"author": "Anthony Hildoer <anthony@bluerival.com>", | ||
@@ -11,6 +11,6 @@ "repository": { | ||
"dependencies": { | ||
"async": "~0" | ||
"async": "0.9.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1" | ||
"mocha": "2.0.1" | ||
}, | ||
@@ -24,5 +24,5 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=0.6.0" | ||
"node": ">=0.10.33" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -39,2 +39,3 @@ 'use strict'; | ||
var updates = 0; | ||
var keyUpdates = {}; | ||
@@ -57,5 +58,12 @@ var lastUpdateKeys; | ||
update: function ( key, callback ) { | ||
var keyStr = JSON.stringify( key ); | ||
lastUpdateKey = key; | ||
if ( !keyUpdates.hasOwnProperty( keyStr ) ) { | ||
keyUpdates[keyStr] = 0; | ||
} | ||
keyUpdates[keyStr]++; | ||
updates++; | ||
callback( key + 'check' ); | ||
callback( keyStr + 'check' ); | ||
} | ||
@@ -100,9 +108,41 @@ } ); | ||
updates = 0; | ||
keyUpdates = {}; | ||
var tasks = []; | ||
var pushTask = function () { | ||
tasks.push( function ( callback ) { | ||
testCache.get( 'set', function () { | ||
callback( null, true ); | ||
} ); | ||
tasks.push( function ( done ) { | ||
async.parallel( [ | ||
function ( done ) { | ||
testCache.get( 'set1', function () { | ||
done( null, true ); | ||
} ); | ||
}, | ||
function ( done ) { | ||
testCache.get( 'set1', function () { | ||
done( null, true ); | ||
} ); | ||
}, | ||
function ( done ) { | ||
testCache.get( 'set1', function () { | ||
done( null, true ); | ||
} ); | ||
}, | ||
function ( done ) { | ||
testCache.get( 'set2', function () { | ||
done( null, true ); | ||
} ); | ||
}, | ||
function ( done ) { | ||
testCache.get( 'set2', function () { | ||
done( null, true ); | ||
} ); | ||
}, | ||
function ( done ) { | ||
testCache.get( 'set2', function () { | ||
done( null, true ); | ||
} ); | ||
} | ||
], done ); | ||
} ); | ||
@@ -116,3 +156,5 @@ }; | ||
async.parallel( tasks, function () { | ||
assert.strictEqual( updates, 1 ); | ||
assert.strictEqual( updates, 2 ); | ||
assert.strictEqual( keyUpdates['"set1"'], 1 ); | ||
assert.strictEqual( keyUpdates['"set2"'], 1 ); | ||
done(); | ||
@@ -181,2 +223,8 @@ } ); | ||
lastUpdateKey = key; | ||
var keyStr = JSON.stringify( key ); | ||
if ( !keyUpdates.hasOwnProperty( keyStr ) ) { | ||
keyUpdates[keyStr] = 0; | ||
} | ||
keyUpdates[keyStr]++; | ||
updates++; | ||
@@ -211,2 +259,8 @@ callback( key + 'check' ); | ||
lastUpdateKey = key; | ||
var keyStr = JSON.stringify( key ); | ||
if ( !keyUpdates.hasOwnProperty( keyStr ) ) { | ||
keyUpdates[keyStr] = 0; | ||
} | ||
keyUpdates[keyStr]++; | ||
updates++; | ||
@@ -254,2 +308,8 @@ callback( key + 'check' ); | ||
lastUpdateKey = key; | ||
var keyStr = JSON.stringify( key ); | ||
if ( !keyUpdates.hasOwnProperty( keyStr ) ) { | ||
keyUpdates[keyStr] = 0; | ||
} | ||
keyUpdates[keyStr]++; | ||
updates++; | ||
@@ -256,0 +316,0 @@ callback( key + 'check' ); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
33833
764
1
0
+ Addedasync@0.9.0(transitive)
- Removedasync@0.9.2(transitive)
Updatedasync@0.9.0