Skip to content

Commit dea5e75

Browse files
committed
Use __proto__ pattern instead of Object.create
1 parent 97e632b commit dea5e75

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/utils/filter-config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type FilterConfig = {
1818
}
1919

2020
export function toFilterConfig(obj: unknown): FilterConfig {
21-
const normalized = Object.create(null) as FilterConfig
21+
const normalized = { __proto__: null } as FilterConfig
2222
if (!isObject(obj)) {
2323
return normalized
2424
}

src/utils/result.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class ResultError extends Error {
4646
*/
4747
export function requireOk<T>(result: CResult<T>, context: string): T {
4848
if (!result.ok) {
49-
const errorOptions = Object.create(null) as ResultErrorOptions
49+
const errorOptions = { __proto__: null } as ResultErrorOptions
5050
if (result.code !== undefined) {
5151
errorOptions.code = result.code
5252
}

0 commit comments

Comments
 (0)