Skip to content

Commit

Permalink
upgrade dependencies and github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cajames committed Jan 29, 2024
2 parents 85c8f2d + 217fae9 commit 7cbaf7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node Node.js
uses: actions/setup-node@v4

- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn test
Expand Down
5 changes: 4 additions & 1 deletion src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ export const memorise = <RESULT extends any = any, ARGS extends any[] = any[]>(
lruOptions = {},
} = options;

const _cache = cache || (LRU(lruOptions.max, lruOptions.ttl) as Lru<RESULT>);
const cacheOptions = { ...defaultLRUOptions, ...lruOptions };

const _cache = (cache ||
lru(cacheOptions.max, cacheOptions.ttl)) as LRU<RESULT>;

// Cached fn
const returnFn = (...args: ARGS): RESULT => {
Expand Down

0 comments on commit 7cbaf7b

Please sign in to comment.