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

asc

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asc - npm Package Compare versions

Comparing version 0.1.2 to 1.0.0

8

package.json
{
"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' );

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