Socket
Socket
Sign inDemoInstall

metro-cache

Package Overview
Dependencies
Maintainers
1
Versions
143
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metro-cache - npm Package Compare versions

Comparing version 0.32.0 to 0.33.0

src.real/stores/__tests__/HttpStore-test.js

7

package.json
{
"version": "0.32.0",
"version": "0.33.0",
"name": "metro-cache",

@@ -16,5 +16,6 @@ "description": "🚇 Cache layers for Metro",

"jest-serializer": "22.4.3",
"metro-core": "0.32.0",
"mkdirp": "^0.5.1"
"metro-core": "0.33.0",
"mkdirp": "^0.5.1",
"rimraf": "^2.5.4"
}
}

@@ -15,3 +15,3 @@ /**

const FileStore = require('./stores/FileStore');
const PersistedMapStore = require('./stores/PersistedMapStore');
const HttpStore = require('./stores/HttpStore');

@@ -24,4 +24,4 @@ const stableHash = require('./stableHash');

module.exports.FileStore = FileStore;
module.exports.PersistedMapStore = PersistedMapStore;
module.exports.HttpStore = HttpStore;
module.exports.stableHash = stableHash;

@@ -16,2 +16,3 @@ /**

const path = require('path');
const rimraf = require('rimraf');

@@ -31,9 +32,4 @@ import type {TransformedCode} from 'metro/src/JSTransformer/worker';

constructor(options: Options) {
const root = options.root;
for (let i = 0; i < 256; i++) {
mkdirp.sync(path.join(root, ('0' + i.toString(16)).slice(-2)));
}
this._root = root;
this._root = options.root;
this._createDirs();
}

@@ -70,2 +66,7 @@

clear() {
this._removeDirs();
this._createDirs();
}
_getFilePath(key: Buffer): string {

@@ -78,4 +79,16 @@ return path.join(

}
_createDirs() {
for (let i = 0; i < 256; i++) {
mkdirp.sync(path.join(this._root, ('0' + i.toString(16)).slice(-2)));
}
}
_removeDirs() {
for (let i = 0; i < 256; i++) {
rimraf.sync(path.join(this._root, ('0' + i.toString(16)).slice(-2)));
}
}
}
module.exports = FileStore;

@@ -16,2 +16,3 @@ /**

set(key: Buffer, value: T): void | Promise<void>,
clear(): void | Promise<void>,
};

@@ -15,3 +15,3 @@ /**

const FileStore = require('./stores/FileStore');
const PersistedMapStore = require('./stores/PersistedMapStore');
const HttpStore = require('./stores/HttpStore');

@@ -24,4 +24,4 @@ const stableHash = require('./stableHash');

module.exports.FileStore = FileStore;
module.exports.PersistedMapStore = PersistedMapStore;
module.exports.HttpStore = HttpStore;
module.exports.stableHash = stableHash;

@@ -16,2 +16,3 @@ /**

const path = require('path');
const rimraf = require('rimraf');

@@ -31,9 +32,4 @@

constructor(options) {
const root = options.root;
for (let i = 0; i < 256; i++) {
mkdirp.sync(path.join(root, ('0' + i.toString(16)).slice(-2)));
}
this._root = root;
this._root = options.root;
this._createDirs();
}

@@ -70,2 +66,7 @@

clear() {
this._removeDirs();
this._createDirs();
}
_getFilePath(key) {

@@ -77,2 +78,14 @@ return path.join(

}
_createDirs() {
for (let i = 0; i < 256; i++) {
mkdirp.sync(path.join(this._root, ('0' + i.toString(16)).slice(-2)));
}
}
_removeDirs() {
for (let i = 0; i < 256; i++) {
rimraf.sync(path.join(this._root, ('0' + i.toString(16)).slice(-2)));
}
}}

@@ -79,0 +92,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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