diff --git a/package.json b/package.json index 9a9fec5..2ea9b92 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "dist" ], "type": "module", + "sideEffects": false, "main": "./dist/index.js", "module": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/index.ts b/src/index.ts index cd2223b..0a1f69a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,16 +1,10 @@ -/** - * safe-formdata: Boundary-focused FormData parser - * - * See AGENTS.md for design rules and boundary definition. - */ +import type { ParseResult } from "#types/ParseResult"; export { parse } from "#parse"; export type { IssueCode } from "#types/IssueCode"; export type { ParseIssue } from "#types/ParseIssue"; -export type { ParseResult } from "#types/ParseResult"; - -import type { ParseResult } from "#types/ParseResult"; +export type { ParseResult }; export type SuccessResult = Extract }>; export type FailureResult = Extract; diff --git a/src/issues/forbiddenKeys.ts b/src/issues/forbiddenKeys.ts index c2b1467..a228e54 100644 --- a/src/issues/forbiddenKeys.ts +++ b/src/issues/forbiddenKeys.ts @@ -14,8 +14,8 @@ * * @see {@link https://github.com/roottool/safe-formdata/blob/main/AGENTS.md#prototype-safety AGENTS.md > Security rules > Prototype safety} */ -export const FORBIDDEN_KEYS = new Set([ +export const FORBIDDEN_KEYS: ReadonlySet = new Set([ "__proto__", "prototype", "constructor", -] as const satisfies readonly string[]); +]); diff --git a/tsconfig.examples.json b/tsconfig.examples.json index 570b9b7..89a7d07 100644 --- a/tsconfig.examples.json +++ b/tsconfig.examples.json @@ -3,7 +3,8 @@ "compilerOptions": { "noEmit": true, "declaration": false, - "declarationMap": false + "declarationMap": false, + "isolatedDeclarations": false }, "include": ["examples/**/*.ts"] } diff --git a/tsconfig.json b/tsconfig.json index 068f743..2e1c930 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "moduleResolution": "nodenext", "rewriteRelativeImportExtensions": true, "erasableSyntaxOnly": true, + "isolatedDeclarations": true, "verbatimModuleSyntax": true, // Emit @@ -15,7 +16,6 @@ "declarationMap": true, "sourceMap": true, "outDir": "./dist", - "removeComments": true, // Type Checking (strict mode) "strict": true,