From 8bce33d2659e101c79fd33e70caca66db6770dc0 Mon Sep 17 00:00:00 2001 From: Damien Chazoule Date: Tue, 5 Oct 2021 08:50:12 +0200 Subject: [PATCH] Moving '__tests__' To 'test' --- Cache/Memoize.js | 12 +++--------- Cache/{__tests__ => test}/Memoize.test.js | 0 2 files changed, 3 insertions(+), 9 deletions(-) rename Cache/{__tests__ => test}/Memoize.test.js (100%) diff --git a/Cache/Memoize.js b/Cache/Memoize.js index 932b6187c..36309cbb3 100644 --- a/Cache/Memoize.js +++ b/Cache/Memoize.js @@ -4,24 +4,18 @@ * @returns */ export const memoize = (func) => { - // eslint-disable-next-line no-console - console.log(`Creating cache for function '${func.name}'`) - + // Initializing new cache const cache = {} return (...args) => { const [arg] = args if (arg in cache) { - // eslint-disable-next-line no-console - console.log(`Reading cache with argument ${arg}`) - + // Reading cache by argument return cache[arg] } - // eslint-disable-next-line no-console - console.log(`Updating cache with argument ${arg}`) - + // Updating cache by argument const result = func(arg) cache[arg] = result return result diff --git a/Cache/__tests__/Memoize.test.js b/Cache/test/Memoize.test.js similarity index 100% rename from Cache/__tests__/Memoize.test.js rename to Cache/test/Memoize.test.js