Skip to content

Commit 2d1a44b

Browse files
authored
fix: ignore duplicate identifier (#104)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced module compatibility by adding explicit support for ES module imports alongside existing CommonJS support. - Improved security capabilities with new options for robust token management and secure HTTP interactions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 58f097a commit 2d1a44b

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@types/type-is": "^1.6.7",
6464
"beautify-benchmark": "^0.2.4",
6565
"benchmark": "^2.1.4",
66-
"egg": "^4.0.1",
66+
"egg": "^4.0.4",
6767
"egg-view-nunjucks": "^2.3.0",
6868
"eslint": "8",
6969
"eslint-config-egg": "14",
@@ -111,5 +111,6 @@
111111
"src"
112112
],
113113
"types": "./dist/commonjs/index.d.ts",
114-
"main": "./dist/commonjs/index.js"
114+
"main": "./dist/commonjs/index.js",
115+
"module": "./dist/esm/index.js"
115116
}

src/app/extend/context.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,12 @@ export default class SecurityContext extends Context {
270270

271271
declare module '@eggjs/core' {
272272
interface Context {
273+
// @ts-expect-error duplicate identifier
273274
get securityOptions(): Partial<SecurityConfig & SecurityHelperConfig>;
274275
isSafeDomain(domain: string, customWhiteList?: string[]): boolean;
276+
// @ts-expect-error duplicate identifier
275277
get nonce(): string;
278+
// @ts-expect-error duplicate identifier
276279
get csrf(): string;
277280
ensureCsrfSecret(rotate?: boolean): void;
278281
rotateCsrfSecret(): void;

src/index.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1 @@
11
import './types.js';
2-
3-
// module.exports = require('./app/middleware/securities');
4-
// module.exports.csp = require('./lib/middlewares/csp');
5-
// module.exports.csrf = require('./lib/middlewares/csrf');
6-
// module.exports.methodNoAllow = require('./lib/middlewares/methodnoallow');
7-
// module.exports.noopen = require('./lib/middlewares/noopen');
8-
// module.exports.nosniff = require('./lib/middlewares/nosniff');
9-
// module.exports.xssProtection = require('./lib/middlewares/xssProtection');
10-
// module.exports.xframe = require('./lib/middlewares/xframe');
11-
// module.exports.safeRedirect = require('./lib/safe_redirect');
12-
// module.exports.utils = require('./lib/utils');

0 commit comments

Comments
 (0)