Skip to content

Commit

Permalink
V3.2.0 (#119) (#120)
Browse files Browse the repository at this point in the history
* v3.2.0

* updated badges in readme

* Removed license date in readme

* Updated license file date 2022

Co-authored-by: Frederic Charette <[email protected]>

Co-authored-by: Frederic Charette <[email protected]>
  • Loading branch information
fed135 and Frederic Charette authored Jun 23, 2022
1 parent bf6071c commit 243d861
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 20 deletions.
5 changes: 3 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tests
README.md
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Expand All @@ -8,4 +7,6 @@ CONTRIBUTING.md
package-lock.json
*.clinic*
sample.txt
.github
.github
logo.png
yarn.lock
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2021 Frederic Charette
Copyright 2022 Frederic Charette

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h1 align="center">
<img alt="HA-store" width="300px" src="./logo.png" />
<br/>
High-Availability store
</h1>
<h3 align="center">
Expand All @@ -9,8 +11,7 @@

[![ha-store](https://img.shields.io/npm/v/ha-store.svg)](https://www.npmjs.com/package/ha-store)
[![Node](https://img.shields.io/badge/node->%3D14.0-blue.svg)](https://nodejs.org)
[![Build Status](https://travis-ci.org/fed135/ha-store.svg?branch=master)](https://travis-ci.org/fed135/ha-store)
[![Dependencies Status](https://david-dm.org/fed135/ha-store.svg)](https://david-dm.org/fed135/ha-store)
[![Dependencies Status](https://img.shields.io/librariesio/release/npm/ha-store)](https://github.com/fed135/ha-store/security/dependabot)

---

Expand Down Expand Up @@ -110,5 +111,5 @@ I am always looking for more maintainers, as well.

## License

[Apache 2.0](LICENSE) (c) 2021 Frederic Charette
[Apache 2.0](LICENSE) (c) Frederic Charette

Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ha-store",
"version": "3.1.1",
"version": "3.2.0",
"description": "Efficient data fetching",
"main": "src/index.js",
"scripts": {
Expand Down Expand Up @@ -36,11 +36,11 @@
"license": "Apache-2.0",
"devDependencies": {
"chai": "^4.3.0",
"eslint": "^7.29.0",
"eslint": "^8.18.0",
"ha-store-redis": "^2.0.1",
"mocha": "^9.0.0",
"sinon": "^11.1.0",
"split2": "^3.2.0"
"mocha": "^10.0.0",
"sinon": "^14.0.0",
"split2": "^4.1.0"
},
"contributors": [
"frederic charette <[email protected]>",
Expand All @@ -49,6 +49,6 @@
],
"typings": "./src/index.d.ts",
"dependencies": {
"lru-cache": "^6.0.0"
"lru-cache": "^7.10.0"
}
}
4 changes: 0 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ class HaStore extends EventEmitter {

this.config = hydrateConfig(initialConfig);

if (this.setMaxListeners) {
this.setMaxListeners(Infinity);
}

this.store = this.config.cache ? this.config.store(this.config) : null;
this.storeGetMulti = (key, ids) => this.store.getMulti(contextRecordKey(key), ids);
this.storeGet = (key, id) => ([ this.store.get(recordKey(key, id)) ]);
Expand Down
8 changes: 4 additions & 4 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const lru = require('lru-cache');
function localStore(config) {
const store = new lru({
max: config.cache.limit,
maxAge: config.cache.ttl,
ttl: config.cache.ttl,
});

function get(key) {
Expand All @@ -30,14 +30,14 @@ function localStore(config) {

function clear(key) {
if (key === '*') {
store.reset();
store.clear();
return true;
}
return store.del(key);
return store.delete(key);
}

function size() {
return store.itemCount;
return store.size;
}

return { get, getMulti, set, clear, size };
Expand Down

0 comments on commit 243d861

Please sign in to comment.