Skip to content

Commit 919c1f3

Browse files
authored
feat: use ylru@2 (#2)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added an official MIT License to clarify usage rights. - **Documentation** - Updated project documentation with fresh badges and new sections highlighting licensing details and contributor information. - **Chores** - Streamlined internal build processes and configuration settings for improved maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 3c86268 commit 919c1f3

File tree

5 files changed

+55
-25
lines changed

5 files changed

+55
-25
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018-present node-modules and the contributors.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
[![Test coverage][codecov-image]][codecov-url]
66
[![Known Vulnerabilities][snyk-image]][snyk-url]
77
[![npm download][download-image]][download-url]
8+
[![Node.js Version](https://img.shields.io/node/v/cache-content-type.svg?style=flat)](https://nodejs.org/en/download/)
9+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
10+
![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/node-modules/cache-content-type)
811

912
[npm-image]: https://img.shields.io/npm/v/cache-content-type.svg?style=flat-square
1013
[npm-url]: https://npmjs.org/package/cache-content-type
@@ -31,3 +34,13 @@ import { getType } from 'cache-content-type';
3134
const contentType = getType('html');
3235
assert.equal(contentType, 'text/html; charset=utf-8');
3336
```
37+
38+
## License
39+
40+
[MIT](LICENSE)
41+
42+
## Contributors
43+
44+
[![Contributors](https://contrib.rocks/image?repo=node-modules/cache-content-type)](https://github.com/node-modules/cache-content-type/graphs/contributors)
45+
46+
Made with [contributors-img](https://contrib.rocks).

package.json

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,31 @@
66
},
77
"description": "Create a full Content-Type header given a MIME type or extension and cache the result",
88
"scripts": {
9-
"test": "npm run lint -- --fix && egg-bin test",
10-
"ci": "npm run lint && egg-bin cov && npm run prepublishOnly",
9+
"clean": "tsc --build --clean",
10+
"pretest": "npm run clean && npm run lint -- --fix",
11+
"test": "egg-bin test",
12+
"preci": "npm run clean && npm run lint",
13+
"ci": "egg-bin cov",
14+
"postci": "npm run prepublishOnly && npm run clean",
1115
"lint": "eslint src test",
1216
"prepublishOnly": "tshy && tshy-after"
1317
},
1418
"dependencies": {
1519
"mime-types": "^2.1.35",
16-
"ylru": "^1.4.0"
20+
"ylru": "^2.0.0"
1721
},
1822
"devDependencies": {
19-
"@eggjs/tsconfig": "^1.3.3",
20-
"@types/mime-types": "^2.1.4",
21-
"@types/mocha": "^10.0.1",
22-
"@types/node": "^20.2.5",
23-
"egg-bin": "6",
23+
"@eggjs/tsconfig": "2",
24+
"@types/mime-types": "2",
25+
"@types/mocha": "10",
26+
"@types/node": "^22",
27+
"@eggjs/bin": "7",
2428
"eslint": "8",
25-
"eslint-config-egg": "13",
26-
"mm": "3",
27-
"tshy": "^1.15.1",
28-
"tshy-after": "^1.0.0",
29-
"typescript": "^5.4.5"
29+
"eslint-config-egg": "14",
30+
"mm": "4",
31+
"tshy": "3",
32+
"tshy-after": "1",
33+
"typescript": "5"
3034
},
3135
"repository": {
3236
"type": "git",
@@ -50,12 +54,10 @@
5054
"./package.json": "./package.json",
5155
".": {
5256
"import": {
53-
"source": "./src/index.ts",
5457
"types": "./dist/esm/index.d.ts",
5558
"default": "./dist/esm/index.js"
5659
},
5760
"require": {
58-
"source": "./src/index.ts",
5961
"types": "./dist/commonjs/index.d.ts",
6062
"default": "./dist/commonjs/index.js"
6163
}
@@ -66,5 +68,6 @@
6668
"src"
6769
],
6870
"main": "./dist/commonjs/index.js",
69-
"types": "./dist/commonjs/index.d.ts"
71+
"types": "./dist/commonjs/index.d.ts",
72+
"module": "./dist/esm/index.js"
7073
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import mimeTypes from 'mime-types';
2-
import LRU from 'ylru';
2+
import { LRU } from 'ylru';
33

44
let typeLRUCache: LRU;
55

tsconfig.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
2-
"extends": "@eggjs/tsconfig",
3-
"compilerOptions": {
4-
"strict": true,
5-
"noImplicitAny": true,
6-
"target": "ES2022",
7-
"module": "NodeNext",
8-
"moduleResolution": "NodeNext"
9-
}
2+
"extends": "@eggjs/tsconfig"
103
}

0 commit comments

Comments
 (0)