This repository has been archived by the owner on Nov 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge pull request #1 from azurystudios/dev
merge code for v2
- Loading branch information
Showing
12 changed files
with
8,024 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: '/' | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
dev.js | ||
node_modules | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
dev.js | ||
dev | ||
src | ||
.github | ||
changelog.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# cachu's changelog | ||
|
||
Available Releases: | ||
|
||
- [v2.0.0](#2.0.0) | ||
|
||
## 2.0.0 | ||
|
||
### Changes | ||
|
||
- renamed functions | ||
- added global instance | ||
- added `purgeMany`, `getMany`, `purgeManyByCondition`, `getManyByCondition`, `getKeysOfItems`, `getValuesOfItems`, `getAmountOfItems`, and `each` functions | ||
- added engine requirements | ||
- added funding | ||
- minified package | ||
- made testing easier | ||
|
||
### Bug Fixes | ||
|
||
- fixed deletion of expired items |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Cachu } from '../src/instance.mjs' | ||
|
||
const cachu = new Cachu({ | ||
maxAge: 300 | ||
}) | ||
|
||
async function dev() { | ||
await cachu.set(1, 'other') | ||
|
||
setTimeout(async () => { | ||
await cachu.set(2, 'item') | ||
}, 250) | ||
|
||
setTimeout(async () => { | ||
await cachu.set(3, 'item') | ||
}, 500) | ||
|
||
setTimeout(async () => { | ||
console.log(await cachu.purgeManyByCondition(item => { | ||
return item[1] === 'other' | ||
})) | ||
console.log(cachu.store) | ||
}, 1000) | ||
} | ||
dev() |
Oops, something went wrong.