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

wipe-node-cache

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wipe-node-cache - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

15

lib/index.js
"use strict";
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function waveCallback_default() {

@@ -15,3 +17,3 @@ return true;

var parent = modules[moduleName];
var line = parent.children;
var line = parent.children || [];
line.forEach(function (_ref) {

@@ -48,4 +50,4 @@ var childName = _ref.id;

function purge(cache, wipeList, callback, removeFromCache) {
burn(cache, wipeList, assignParents(cache), callback, removeFromCache);
function purge(cache, wipeList, callback, removeFromCache, parents) {
burn(cache, wipeList, parents || assignParents(cache), callback, removeFromCache);
}

@@ -93,7 +95,10 @@

var wipeList = [];
callback(buildIndexForward(cache), function (name) {
var parents = assignParents(cache);
var simpleIndex = buildIndexForward(cache);
var compositeIndex = [].concat(_toConsumableArray(new Set([].concat(_toConsumableArray(simpleIndex), _toConsumableArray(Object.keys(parents))))));
callback(compositeIndex, function (name) {
removeFromCache(name);
wipeList.push(name);
});
return purge(cache, wipeList, waveCallback);
return purge(cache, wipeList, waveCallback, undefined, parents);
}

@@ -100,0 +105,0 @@

{
"name": "wipe-node-cache",
"version": "2.1.0",
"version": "2.1.1",
"description": "Wipes node.js cache in a controled way.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -13,3 +13,3 @@ function waveCallback_default() {

const parent = modules[moduleName];
const line = parent.children;
const line = parent.children || [];
line.forEach(({id: childName}) => {

@@ -42,4 +42,4 @@ result[childName] = result[childName] || {parents: []};

function purge(cache, wipeList, callback, removeFromCache) {
burn(cache, wipeList, assignParents(cache), callback, removeFromCache);
function purge(cache, wipeList, callback, removeFromCache, parents) {
burn(cache, wipeList, parents || assignParents(cache), callback, removeFromCache);
}

@@ -88,7 +88,10 @@

const wipeList = [];
callback(buildIndexForward(cache), name => {
const parents = assignParents(cache);
const simpleIndex = buildIndexForward(cache);
const compositeIndex = [...new Set([...simpleIndex, ...Object.keys(parents)])];
callback(compositeIndex, name => {
removeFromCache(name);
wipeList.push(name);
});
return purge(cache, wipeList, waveCallback);
return purge(cache, wipeList, waveCallback, undefined, parents);
}

@@ -95,0 +98,0 @@

@@ -6,3 +6,3 @@ /*jshint asi:true*/

var assert = require('assert');
const {wipeCache:wipe} = require('../index');
const {wipeCache:wipe} = require('../src/index');

@@ -9,0 +9,0 @@ var stubs = {

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