removeObjectPatternProperties() — react Function Reference
Architecture documentation for the removeObjectPatternProperties() function in minimize.ts from the react codebase.
Entity Profile
Dependency Diagram
graph TD 0131b155_3e21_3450_0c14_08e894f4cbb7["removeObjectPatternProperties()"] 9c061da8_dbf8_4168_823d_991654a3c55d["minimize.ts"] 0131b155_3e21_3450_0c14_08e894f4cbb7 -->|defined in| 9c061da8_dbf8_4168_823d_991654a3c55d 7a9af496_ef6a_d9e8_8eaf_1f386f49e4b3["cloneAst()"] 0131b155_3e21_3450_0c14_08e894f4cbb7 -->|calls| 7a9af496_ef6a_d9e8_8eaf_1f386f49e4b3 style 0131b155_3e21_3450_0c14_08e894f4cbb7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/packages/snap/src/minimize.ts lines 1657–1691
function* removeObjectPatternProperties(ast: t.File): Generator<t.File> {
// Collect all object patterns with properties
const patternSites: Array<{patternIndex: number; propCount: number}> = [];
let patternIndex = 0;
t.traverseFast(ast, node => {
if (t.isObjectPattern(node) && node.properties.length > 0) {
patternSites.push({patternIndex, propCount: node.properties.length});
patternIndex++;
}
});
// For each pattern, try removing each property (from end to start)
for (const {patternIndex: targetPatternIdx, propCount} of patternSites) {
for (let propIdx = propCount - 1; propIdx >= 0; propIdx--) {
const cloned = cloneAst(ast);
let idx = 0;
let modified = false;
t.traverseFast(cloned, node => {
if (modified) return;
if (t.isObjectPattern(node) && node.properties.length > 0) {
if (idx === targetPatternIdx && propIdx < node.properties.length) {
node.properties.splice(propIdx, 1);
modified = true;
}
idx++;
}
});
if (modified) {
yield cloned;
}
}
}
}
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does removeObjectPatternProperties() do?
removeObjectPatternProperties() is a function in the react codebase, defined in compiler/packages/snap/src/minimize.ts.
Where is removeObjectPatternProperties() defined?
removeObjectPatternProperties() is defined in compiler/packages/snap/src/minimize.ts at line 1657.
What does removeObjectPatternProperties() call?
removeObjectPatternProperties() calls 1 function(s): cloneAst.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free