Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"dist"
],
"type": "module",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
10 changes: 2 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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<ParseResult, { data: Record<string, string | File> }>;
export type FailureResult = Extract<ParseResult, { data: null }>;
4 changes: 2 additions & 2 deletions src/issues/forbiddenKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>([
export const FORBIDDEN_KEYS: ReadonlySet<string> = new Set([
"__proto__",
"prototype",
"constructor",
] as const satisfies readonly string[]);
]);
3 changes: 2 additions & 1 deletion tsconfig.examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"noEmit": true,
"declaration": false,
"declarationMap": false
"declarationMap": false,
"isolatedDeclarations": false
},
"include": ["examples/**/*.ts"]
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"moduleResolution": "nodenext",
"rewriteRelativeImportExtensions": true,
"erasableSyntaxOnly": true,
"isolatedDeclarations": true,
"verbatimModuleSyntax": true,

// Emit
Expand All @@ -15,7 +16,6 @@
"declarationMap": true,
"sourceMap": true,
"outDir": "./dist",
"removeComments": true,

// Type Checking (strict mode)
"strict": true,
Expand Down