Improve support for `exactOptionalPropertyTypes`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend-api-design
Research direction
Start by locating the Options<P, C> interface shown in the issue and check how its optional properties are declared and used. Update the optional property types to allow explicit undefined, then run the relevant TypeScript checks or tests to confirm the types accept those assignments under exactOptionalPropertyTypes.
Written by the indexing model from the issue text.
Description
The Options type is defined as:
export interface Options<P, C> {
/** Minimum zoom level at which clusters are generated. @default 0 */
minZoom?: number;
/** Maximum zoom level at which clusters are generated; capped at 30. @default 16 */
maxZoom?: number;
/** Minimum number of points to form a cluster. @default 2 */
minPoints?: number;
/** Cluster radius, in pixels. @default 40 */
radius?: number;
/** (Tiles) Tile extent; radius is calculated relative to this value. @default 512 */
extent?: number;
/** Size of the KD-tree leaf node; affects performance. @default 64 */
nodeSize?: number;
/** Whether timing info should be logged. @default false */
log?: boolean;
/** Whether to generate ids for input features in vector tiles. @default false */
generateId?: boolean;
/** Cluster properties for a single point, e.g. `props => ({sum: props.myValue})`. Defaults to identity. */
map?: (props: P) => C;
/** Merges two clusters' properties, e.g. `(accumulated, props) => { accumulated.sum += props.sum; }` */
reduce?: ((accumulated: C, props: Readonly<C>) => void) | null;
}
If I enable exactOptionalPropertyTypes to true, I am no longer able to set map and other properties to undefined. Please consider adding undefined to the optional properties so they can be explicitly set to undefined as well.
- Dominant language
- JavaScript
- Stars
- 2.4k
- Forks
- 303
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/supercluster
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mapbox/supercluster#254 · 2 comments ·
-
Missing points when bounds are scoped to the extent of pointsMay be free again A pull request for this issue was closed without being merged. Openquestion
Difficulty 4/5 3-5 days Newbie friendliness 38/100
mapbox/supercluster#234 · 1 comment ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
mapbox/supercluster#218 · 4 comments ·
-
Nested geoJson properties are copied by referencePossibly taken @mrkwanzaa claimed this 1335 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
mapbox/supercluster#215 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mapbox/supercluster#211 · 2 comments ·
All issues in mapbox/supercluster
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Add: Story4 CZOpencheck:passed logos:add
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
adobe/helix-shared#1310 ·
Maintainers usually reply within 1 day
-
[workshop-sim] Improve: Strengthen practice and checkpoints in Step 05 (What Are Agentic Workflows?)Openfeedback simulation workshop
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
githubnext/gh-aw-workshop#4972 ·
Maintainers usually reply within 1 day
-
agent/ci-maintainer ci good first issue help wanted stage/010-actionable
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
cncf/endusers#1890 · 3 comments ·
Maintainers usually reply within 1 day