evicting-cache 2.3.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +139 -0
- package/README.md +7 -5
- package/package.json +50 -28
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
## [3.0.3](https://github.com/D1g1talEntr0py/evicting-cache/compare/v3.0.2...v3.0.3) (2026-03-16)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **release:** I just want this to work... (6a8b4103f7720c00c502ca9cf50c4f262d35afb0)
|
|
6
|
+
* **release:** kill me now (f8d2196a740389ea0acec8b9deedf408a2784c42)
|
|
7
|
+
|
|
8
|
+
## [3.0.2](https://github.com/D1g1talEntr0py/evicting-cache/compare/v3.0.1...v3.0.2) (2026-03-16)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **ci:** Fix publishing to include a valid release (997fa6a8f56d9b3fe91f8cc2206b1169607ddb25)
|
|
13
|
+
* **ci:** fixed autoInstallPeers mismatch (c8778b682546bd9767a3664a858435776b59f1b3)
|
|
14
|
+
* **ci:** more fun with peer install conflicts (53fa74b13e0688059722ad8634c1bf8bfa596de5)
|
|
15
|
+
* **ci:** more GitHub actions nonsense (e211d1ad81397f4b720dc534e4f8cbe9f02ce44f)
|
|
16
|
+
|
|
17
|
+
### Documentation
|
|
18
|
+
|
|
19
|
+
* fixed badges on README.md, again (b4996da990f80df4230abfe4fc929954931ba989)
|
|
20
|
+
|
|
21
|
+
### Miscellaneous Chores
|
|
22
|
+
|
|
23
|
+
* **deps:** updated dev dependencies and fixed package.json (6ee9c740653667b6f7f2ba5d26cab7280ae61b40)
|
|
24
|
+
|
|
25
|
+
## [3.0.1](https://github.com/D1g1talEntr0py/evicting-cache/compare/v3.0.0...v3.0.1) (2026-03-01)
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* fixed invalid flag for type-check script (808b4d21b02c22a46aeaa4b39ff1103dc70f7bc9)
|
|
30
|
+
|
|
31
|
+
### Continuous Integration
|
|
32
|
+
|
|
33
|
+
* added repository to package.json (1dc7b1b2e15432e1020752d740c99d31009336f1)
|
|
34
|
+
|
|
35
|
+
## [3.0.0](https://github.com/D1g1talEntr0py/evicting-cache/compare/v2.2.1...v3.0.0) (2026-03-01)
|
|
36
|
+
|
|
37
|
+
### ⚠ BREAKING CHANGES
|
|
38
|
+
|
|
39
|
+
* None - all changes are backward compatible
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* add batch operations, statistics tracking, and performance optimizations (3dd757608e71e1d4d736cc7d2306ad5bec3392d2)
|
|
44
|
+
Added new API methods:
|
|
45
|
+
- delete(key) - explicit item removal matching Map API
|
|
46
|
+
- forEach(callback, thisArg) - iteration with proper this binding
|
|
47
|
+
- putAll/getAll/deleteAll - batch operations for multiple keys
|
|
48
|
+
- getStats/resetStats - cache hit/miss statistics tracking
|
|
49
|
+
|
|
50
|
+
Performance improvements:
|
|
51
|
+
- Optimized evict() by removing unsafe type assertion
|
|
52
|
+
- Optimized putAndEvict() by eliminating redundant has() check
|
|
53
|
+
|
|
54
|
+
Other improvements:
|
|
55
|
+
- Enhanced getOrPut() error handling documentation
|
|
56
|
+
- Improved type safety using 'unknown' instead of 'any'
|
|
57
|
+
- Added comprehensive test suite maintaining 100% coverage
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Documentation
|
|
61
|
+
|
|
62
|
+
* update badges on README.md (dfdde3bf8dd52f70035c376055fbcdfadd972f90)
|
|
63
|
+
* update README with comprehensive documentation (8476509c194e674cca5c033fa701a996e067c3dd)
|
|
64
|
+
- Add badges for npm version, downloads, license, TypeScript, and coverage
|
|
65
|
+
- Add detailed API reference and usage examples for all methods
|
|
66
|
+
- Add performance table showing O(1) operations
|
|
67
|
+
- Standardize code examples to 2-space indentation
|
|
68
|
+
- Fix import statement to use named export { EvictingCache }
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Miscellaneous Chores
|
|
72
|
+
|
|
73
|
+
* **deps:** Updates pnpm lockfile to reflect dependency upgrades (eb9bb5e7d07fecc581977be618cf3d2b0efe2810)
|
|
74
|
+
Refreshes the lockfile to match bumped devDependencies and toolchain updates so installs are reproducible and CI uses the exact updated dependency tree.
|
|
75
|
+
|
|
76
|
+
* **githooks:** Adds commit-msg hook (deb5d8a158283312172a043ee2ceb2b11fea13b6)
|
|
77
|
+
Adds an executable hook that enforces Conventional Commits for all commit messages to keep commit history structured and machine-readable for release tooling and CI validation.
|
|
78
|
+
|
|
79
|
+
* **package:** Updates package exports and devDependencies (ad8e4685fc938aae48baaa2fb254dfc2510a688d)
|
|
80
|
+
Updates the package exports to point to built artifacts and bumps a set of development tooling versions to align with newer runtime and linting ecosystems; removes an inline tsbuild entry to rely on external build tooling.
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Continuous Integration
|
|
84
|
+
|
|
85
|
+
* add packageManager to package.json file (49d43111e3a56f5a2fe34ac915089228b2ba7c90)
|
|
86
|
+
* Adds CI workflow (235caead19ce418229750e13b00ca768598916d5)
|
|
87
|
+
Adds a GitHub Actions CI pipeline that runs installs, linting, type checks, tests with coverage, and builds across a Node matrix to ensure quality and compatibility across supported Node versions.
|
|
88
|
+
|
|
89
|
+
* **release:** Adds release workflow & semantic-release config (0b8da372b6366b947d001a57e4415541e04105b7)
|
|
90
|
+
Automates releases on main by wiring a release workflow and configuring semantic-release so versioning and changelogs are generated from Conventional Commits and publishes artifacts accordingly.
|
|
91
|
+
|
|
92
|
+
# Changelog
|
|
93
|
+
|
|
94
|
+
All notable changes to this project will be documented in this file.
|
|
95
|
+
|
|
96
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
97
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
98
|
+
|
|
99
|
+
## [2.3.1] - 2025-10-28
|
|
100
|
+
|
|
101
|
+
### Changed
|
|
102
|
+
- Updated README with comprehensive documentation of all features
|
|
103
|
+
- Added badges for npm version, downloads, license, TypeScript version, and test coverage
|
|
104
|
+
- Improved code examples in README for clarity
|
|
105
|
+
- Added detailed usage examples for all API methods
|
|
106
|
+
- Added performance characteristics table
|
|
107
|
+
- Added complete API reference section
|
|
108
|
+
- Enhanced TypeScript usage examples
|
|
109
|
+
|
|
110
|
+
### Fixed
|
|
111
|
+
- Fixed import statement in README to use named export `{ EvictingCache }` instead of default import
|
|
112
|
+
|
|
113
|
+
## [2.3.0] - 2025-10-27
|
|
114
|
+
|
|
115
|
+
### Added
|
|
116
|
+
- `delete(key)` method to explicitly remove items from the cache, matching standard Map API
|
|
117
|
+
- `forEach(callback, thisArg?)` method to iterate over cache entries with proper `this` binding support
|
|
118
|
+
- Batch operations for improved performance:
|
|
119
|
+
- `putAll(entries)` - Add multiple key-value pairs at once
|
|
120
|
+
- `getAll(keys)` - Retrieve multiple values (returns Map, excludes missing keys)
|
|
121
|
+
- `deleteAll(keys)` - Remove multiple keys (returns count of removed items)
|
|
122
|
+
- Cache statistics tracking:
|
|
123
|
+
- `getStats()` - Returns hit/miss counts and calculated hit rate
|
|
124
|
+
- `resetStats()` - Resets statistics counters to zero
|
|
125
|
+
- Statistics are automatically tracked on `get()` operations (hits and misses)
|
|
126
|
+
- Comprehensive test suite for all new features maintaining 100% code coverage
|
|
127
|
+
|
|
128
|
+
### Changed
|
|
129
|
+
- Improved `getOrPut()` error handling with explicit documentation that cache state remains unchanged when producer function throws
|
|
130
|
+
- Enhanced `getOrPut()` implementation to be more explicit about error handling behavior
|
|
131
|
+
|
|
132
|
+
### Fixed
|
|
133
|
+
- Performance optimization in `evict()` method - removed unsafe type assertion and simplified iterator usage
|
|
134
|
+
- Performance optimization in `putAndEvict()` method - removed redundant `has()` check, now leverages `delete()` return value
|
|
135
|
+
|
|
136
|
+
### Security
|
|
137
|
+
- Replaced `any` type with `unknown` type in `forEach()` `thisArg` parameter for improved type safety
|
|
138
|
+
|
|
139
|
+
## [2.2.1] - Previous Release
|
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# Evicting Cache
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/evicting-cache)
|
|
4
|
+
[](https://www.npmjs.com/package/evicting-cache)
|
|
5
|
+
[](https://github.com/D1g1talEntr0py/evicting-cache/actions/workflows/ci.yml)
|
|
6
|
+
[](https://codecov.io/gh/D1g1talEntr0py/evicting-cache)
|
|
7
|
+
[](https://github.com/D1g1talEntr0py/evicting-cache/blob/main/LICENSE)
|
|
8
|
+
[](https://nodejs.org)
|
|
9
|
+
[](https://www.typescriptlang.org/)
|
|
8
10
|
|
|
9
11
|
A lightweight, high-performance TypeScript implementation of an LRU (Least Recently Used) cache with automatic eviction.
|
|
10
12
|
|
package/package.json
CHANGED
|
@@ -1,58 +1,80 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "evicting-cache",
|
|
3
3
|
"author": "D1g1talEntr0py",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.3",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "Cache implementation with an LRU evicting policy",
|
|
7
|
+
"homepage": "https://github.com/D1g1talEntr0py/evicting-cache#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/D1g1talEntr0py/evicting-cache"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/D1g1talEntr0py/evicting-cache/issues"
|
|
14
|
+
},
|
|
15
|
+
"maintainers": [
|
|
16
|
+
{
|
|
17
|
+
"name": "D1g1talEntr0py",
|
|
18
|
+
"email": "jason.dimeo@gmail.com"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=20.16.0"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"registry": "https://registry.npmjs.org",
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
7
28
|
"type": "module",
|
|
8
29
|
"exports": {
|
|
9
30
|
".": {
|
|
10
31
|
"types": "./dist/evicting-cache.d.ts",
|
|
11
|
-
"import": "./
|
|
32
|
+
"import": "./dist/evicting-cache.js"
|
|
12
33
|
}
|
|
13
34
|
},
|
|
14
35
|
"files": [
|
|
15
36
|
"dist/",
|
|
16
|
-
"src/"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"evicting-cache",
|
|
21
|
-
"lru",
|
|
22
|
-
"lru-cache",
|
|
23
|
-
"evicting-lru-cache"
|
|
37
|
+
"src/",
|
|
38
|
+
"README.md",
|
|
39
|
+
"CHANGELOG.md",
|
|
40
|
+
"LICENSE"
|
|
24
41
|
],
|
|
25
42
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@eslint/
|
|
43
|
+
"@d1g1tal/tsbuild": "^1.6.0",
|
|
44
|
+
"@eslint/compat": "^2.0.3",
|
|
45
|
+
"@eslint/js": "^10.0.1",
|
|
28
46
|
"@types/eslint": "^9.6.1",
|
|
29
|
-
"@types/node": "^
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
31
|
-
"@typescript-eslint/parser": "^8.
|
|
32
|
-
"@vitest/coverage-v8": "^4.0
|
|
33
|
-
"eslint": "^
|
|
34
|
-
"eslint-plugin-compat": "^
|
|
35
|
-
"eslint-plugin-jsdoc": "^
|
|
36
|
-
"globals": "^
|
|
47
|
+
"@types/node": "^25.5.0",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^8.57.1",
|
|
49
|
+
"@typescript-eslint/parser": "^8.57.1",
|
|
50
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
51
|
+
"eslint": "^10.0.3",
|
|
52
|
+
"eslint-plugin-compat": "^7.0.1",
|
|
53
|
+
"eslint-plugin-jsdoc": "^62.8.0",
|
|
54
|
+
"globals": "^17.4.0",
|
|
37
55
|
"typescript": "^5.9.3",
|
|
38
|
-
"typescript-eslint": "^8.
|
|
39
|
-
"vitest": "^4.0
|
|
56
|
+
"typescript-eslint": "^8.57.1",
|
|
57
|
+
"vitest": "^4.1.0"
|
|
40
58
|
},
|
|
41
59
|
"browserslist": [
|
|
42
60
|
"defaults",
|
|
43
61
|
"not ios_saf < 15",
|
|
44
62
|
"not op_mini all"
|
|
45
63
|
],
|
|
64
|
+
"keywords": [
|
|
65
|
+
"cache",
|
|
66
|
+
"evicting-cache",
|
|
67
|
+
"lru",
|
|
68
|
+
"lru-cache",
|
|
69
|
+
"evicting-lru-cache"
|
|
70
|
+
],
|
|
46
71
|
"scripts": {
|
|
47
72
|
"build": "tsbuild",
|
|
48
73
|
"build:watch": "tsbuild --watch",
|
|
49
|
-
"type-check": "tsbuild --
|
|
50
|
-
"lint": "eslint",
|
|
74
|
+
"type-check": "tsbuild --noEmit",
|
|
75
|
+
"lint": "eslint ./src",
|
|
51
76
|
"test": "vitest run",
|
|
52
77
|
"test:coverage": "vitest run --coverage",
|
|
53
|
-
"test:watch": "vitest"
|
|
54
|
-
"prepublish": "pnpm lint && pnpm test && pnpm -s build --minify --force",
|
|
55
|
-
"preversion": "pnpm lint && pnpm test",
|
|
56
|
-
"version": "node -e \"const fs=require('fs');const d=new Date().toISOString().split('T')[0];const v=require('./package.json').version;let c=fs.readFileSync('CHANGELOG.md','utf8');c=c.replace('## [Unreleased]','## ['+v+'] - '+d);fs.writeFileSync('CHANGELOG.md',c);\" && git add CHANGELOG.md"
|
|
78
|
+
"test:watch": "vitest"
|
|
57
79
|
}
|
|
58
80
|
}
|