Skip to content

Commit

Permalink
merged master into lfu browser cache
Browse files Browse the repository at this point in the history
  • Loading branch information
djdalfaro committed Apr 9, 2021
1 parent 595c0b3 commit ca1a2c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/lfuBrowserCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export default function LFUCache(capacity) {
}

/**
* @param {number} key
* @return {number}
* @param {string} key
* @return {object}
*/
LFUCache.prototype.get = function (key) {
let node = this.nodeHash.get(key);
Expand All @@ -76,8 +76,8 @@ LFUCache.prototype.get = function (key) {
};

/**
* @param {number} key
* @param {number} value
* @param {string} key
* @param {object} value
* @return {void}
*/
LFUCache.prototype.put = function (key, value) {
Expand Down
2 changes: 1 addition & 1 deletion test_files/rhum_test_files/lfuBrowserCache_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Rhum.testPlan('LFU Browser Cache Testing', () => {
async () => {
const cache = new LFUCache(10);
await cache.write(test.nestedObj.queryStr, test.nestedObj.respObj);
for (let key in test.nestedObj.expectedCache) {
for (let key of Object.keys(test.nestedObj.expectedCache)) {
await Rhum.asserts.assertEquals(
cache.get(key),
test.nestedObj.expectedCache[key]
Expand Down
3 changes: 1 addition & 2 deletions test_files/test_variables/lfuBrowserCache_variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const test: { [index: string]: any } = {
lastName
}
}}`,
rootQuery: { 'Movie(id:1)': ['Movie~1'] }, // recheck this line, should include actors
rootQuery: { 'Movie(id:1)': ['Movie~1'] },
expectedCache: {
'Movie~1': {
title: 'Indiana Jones and the Last Crusade',
Expand All @@ -37,7 +37,6 @@ export const test: { [index: string]: any } = {
__typename: 'Movie',
id: '1',
title: 'Indiana Jones and the Last Crusade',
// actors: ['Actor~1', 'Actor~2'],
actors: [
{
__typename: 'Actor',
Expand Down

0 comments on commit ca1a2c0

Please sign in to comment.