Skip to content

Commit

Permalink
Merge pull request #4 from voslartomas/feature/remove-lodash
Browse files Browse the repository at this point in the history
Removing lodash as it is not needed.
  • Loading branch information
havsar authored Nov 21, 2018
2 parents df212d7 + d609cef commit 996bde6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
10 changes: 0 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@
"homepage": "https://github.com/havsar/node-ts-cache#readme",
"dependencies": {
"@types/bluebird": "3.5.24",
"@types/lodash": "4.14.118",
"@types/mocha": "5.2.5",
"@types/node": "10.12.9",
"@types/redis": "2.8.7",
"@types/sinon": "5.0.5",
"bluebird": "3.5.3",
"lodash": "4.17.11",
"redis": "2.8.0"
},
"devDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions src/strategies/ExpirationStrategy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Lodash from 'lodash';
import { IStorage } from '../storages/IStorage';
import { AbstractBaseStrategy } from './AbstractBaseStrategy';

Expand Down Expand Up @@ -32,7 +31,7 @@ export class ExpirationStrategy extends AbstractBaseStrategy {
}

public async setItem(key: string, content: any, options: IOptions): Promise<void> {
options = Lodash.merge({ttl: 60, isLazy: true, isCachedForever: false}, options);
options = { ttl: 60, isLazy: true, isCachedForever: false, ...options }

let meta = {};

Expand Down Expand Up @@ -62,4 +61,4 @@ export class ExpirationStrategy extends AbstractBaseStrategy {
private async unsetKey(key: string): Promise<void> {
await this.storage.setItem(key, undefined);
}
}
}

0 comments on commit 996bde6

Please sign in to comment.