MetaMask / MetaMask/core

[utils] Forbid `undefined` values on request and response objects

Open
#10,199 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
413
Forks
308
Avg merge
1d 4h
Merged PRs (30d)
253

Description

Here's the problem:

```text
> JSON.stringify({ foo: undefined })
'{}'
```

Any request or response objects that are serialized before being transported will lose any fields with the value `undefined`. Introspecting `params` or errors to suss out such fields is beyond the scope of this package, but there's an argument that we should throw errors if we detect that any top-level top-level request or response property exists and has the value `undefined`.

That may also be out of scope for this package, but this is as good a place to track it as any.

Contributor guide

No contributing guide indexed for this repository

Research direction

No file, test, or entry point is named. Start by locating the TypeScript utilities that validate or serialize request and response objects, then determine whether top-level undefined properties are in scope. Done means the agreed behavior is implemented consistently and covered by tests for both request and response objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.