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 2.0.2 to 2.0.3

22

lib/asc.js

@@ -200,8 +200,8 @@ 'use strict';

if ( !this._serviceQueues.hasOwnProperty( marshalledKey ) ) {
this._serviceQueues[ marshalledKey ] = [];
this._serviceQueues[marshalledKey] = [];
}
this._serviceQueues[ marshalledKey ].push( done );
this._serviceQueues[marshalledKey].push( done );
if ( this._serviceQueues[ marshalledKey ].length > 1 ) {
if ( this._serviceQueues[marshalledKey].length > 1 ) {
return;

@@ -216,6 +216,6 @@ }

async.whilst(
() => !hasData && returnErr === null && currentIndex < this._getLayers.length,
done => done( null, !hasData && returnErr === null && currentIndex < this._getLayers.length ),
( done ) => {
const handler = this._getLayers[ currentIndex ];
const handler = this._getLayers[currentIndex];

@@ -239,3 +239,3 @@ handler( key, ( err, data ) => {

returnErr = new Error( 'layer ' + currentIndex + ' failed to return an instance of Error, returned: ' +
__.getType( err ) );
__.getType( err ) );

@@ -262,4 +262,4 @@ } else {

// they trigger another lookup on the same key
const callbacks = this._serviceQueues[ marshalledKey ];
delete this._serviceQueues[ marshalledKey ];
const callbacks = this._serviceQueues[marshalledKey];
delete this._serviceQueues[marshalledKey];

@@ -303,3 +303,3 @@ // fire all callbacks synchronously, in series

this._setLayers[ i ]( key, data, done );
this._setLayers[i]( key, data, done );

@@ -329,3 +329,3 @@ }, ( err ) => {

async.applyEachSeries( this._setLayers, key, data, ( err ) => {
async.applyEachSeries( this._setLayers, key, data )( err => {

@@ -350,3 +350,3 @@ if ( err ) {

async.applyEachSeries( this._clearLayers, key, ( err ) => {
async.applyEachSeries( this._clearLayers, key )( ( err ) => {

@@ -353,0 +353,0 @@ if ( err ) {

@@ -7,2 +7,6 @@ 'use strict';

function hasOwn( obj, field ) {
return Object.hasOwnProperty.call( obj, field );
}
class Memory {

@@ -44,4 +48,4 @@

if ( this._memoryCache.hasOwnProperty( key ) ) {
return done( null, this._memoryCache[ key ] );
if ( hasOwn( this._memoryCache, key ) ) {
return done( null, this._memoryCache[key] );
}

@@ -62,5 +66,5 @@

( done ) => {
this._memoryCache[ key ] = value;
this._memoryCache[key] = value;
setTimeout( () => {
this._memoryCacheTimeouts[key] = setTimeout( () => {
this._memoryClear( key, () => {

@@ -78,12 +82,4 @@ // NO-OP

clear( key, done ) {
if ( this._memoryCacheTimeouts.hasOwnProperty( key ) ) {
clearTimeout( this._memoryCacheTimeouts[ key ] );
}
delete this._memoryCacheTimeouts[ key ];
delete this._memoryCache[ key ];
done();
key = util.marshallKey( key );
this._memoryClear( key, done );
}

@@ -93,9 +89,10 @@

if ( this._memoryCacheTimeouts.hasOwnProperty( key ) ) {
clearTimeout( this._memoryCacheTimeouts[ key ] );
if ( hasOwn( this._memoryCacheTimeouts, key ) ) {
clearTimeout( this._memoryCacheTimeouts[key] );
}
delete this._memoryCacheTimeouts[ key ];
delete this._memoryCache[ key ];
delete this._memoryCacheTimeouts[key];
delete this._memoryCache[key];
done();

@@ -102,0 +99,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": "2.0.2",
"version": "2.0.3",
"author": "Anthony Hildoer <anthony@bluerival.com>",

@@ -15,10 +15,10 @@ "repository": {

"dependencies": {
"async": "2.6.2",
"doublescore": "1.0.0"
"async": "3.2.4",
"doublescore": "1.0.1"
},
"devDependencies": {
"@types/mocha": "5.2.7",
"eslint": "6.1.0",
"glob": "7.1.4",
"mocha": "6.2.0"
"@types/mocha": "9.1.1",
"eslint": "7.32.0",
"glob": "8.0.3",
"mocha": "9.2.2"
},

@@ -25,0 +25,0 @@ "keywords": [

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