From 998d18ae84f5c52e8fa821020c92a2c1c7d65006 Mon Sep 17 00:00:00 2001 From: Randall Schmidt Date: Fri, 9 Jul 2021 14:12:55 -0400 Subject: [PATCH] move source into src dir --- package.json | 2 +- {classes => src/classes}/caching/file_system_cache.js | 0 {classes => src/classes}/caching/key_timeout.js | 0 {classes => src/classes}/caching/memory_cache.js | 0 {classes => src/classes}/headers.js | 0 {classes => src/classes}/response.js | 0 index.js => src/index.js | 0 test/tests.js | 4 ++-- 8 files changed, 3 insertions(+), 3 deletions(-) rename {classes => src/classes}/caching/file_system_cache.js (100%) rename {classes => src/classes}/caching/key_timeout.js (100%) rename {classes => src/classes}/caching/memory_cache.js (100%) rename {classes => src/classes}/headers.js (100%) rename {classes => src/classes}/response.js (100%) rename index.js => src/index.js (100%) diff --git a/package.json b/package.json index e679712..7fad0fb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-fetch-cache", "version": "2.0.3", "description": "node-fetch with a persistent cache.", - "main": "index.js", + "main": "src/index.js", "type": "module", "scripts": { "test": "mocha --timeout 10000 --exit", diff --git a/classes/caching/file_system_cache.js b/src/classes/caching/file_system_cache.js similarity index 100% rename from classes/caching/file_system_cache.js rename to src/classes/caching/file_system_cache.js diff --git a/classes/caching/key_timeout.js b/src/classes/caching/key_timeout.js similarity index 100% rename from classes/caching/key_timeout.js rename to src/classes/caching/key_timeout.js diff --git a/classes/caching/memory_cache.js b/src/classes/caching/memory_cache.js similarity index 100% rename from classes/caching/memory_cache.js rename to src/classes/caching/memory_cache.js diff --git a/classes/headers.js b/src/classes/headers.js similarity index 100% rename from classes/headers.js rename to src/classes/headers.js diff --git a/classes/response.js b/src/classes/response.js similarity index 100% rename from classes/response.js rename to src/classes/response.js diff --git a/index.js b/src/index.js similarity index 100% rename from index.js rename to src/index.js diff --git a/test/tests.js b/test/tests.js index 9293ad5..747d7b1 100644 --- a/test/tests.js +++ b/test/tests.js @@ -7,7 +7,7 @@ import rimraf from 'rimraf'; import path from 'path'; import { URLSearchParams } from 'url'; import standardFetch from 'node-fetch'; -import FetchCache, { MemoryCache, FileSystemCache } from '../index.js'; +import FetchCache, { MemoryCache, FileSystemCache } from '../src/index.js'; import { Agent } from 'http'; const __dirname = dirname(fileURLToPath(import.meta.url)); @@ -260,7 +260,7 @@ describe('Cache tests', function() { it('Gives different read streams different cache keys', async function() { const s1 = fs.createReadStream(path.join(__dirname, 'expected_png.png')); - const s2 = fs.createReadStream(path.join(__dirname, '..', 'index.js')); + const s2 = fs.createReadStream(path.join(__dirname, '..', 'src', 'index.js')); res = await cachedFetch(TWO_HUNDRED_URL, post(s1)); assert.strictEqual(res.fromCache, false);