Skip to content

Commit c1e0f07

Browse files
committed
chore: Remove renamed SpreadProperty checks
1 parent 790b81b commit c1e0f07

File tree

4 files changed

+3
-11
lines changed

4 files changed

+3
-11
lines changed

src/handlers/propTypeCompositionHandler.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ function amendComposes(documentation, path) {
3535
function processObjectExpression(documentation, path) {
3636
path.get('properties').each(function(propertyPath) {
3737
switch (propertyPath.node.type) {
38-
case types.SpreadProperty.name: // bc for older estree version
3938
case types.SpreadElement.name:
4039
amendComposes(
4140
documentation,

src/handlers/propTypeHandler.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ function amendPropTypes(getDescriptor, path) {
5555
}
5656
break;
5757
}
58-
case types.SpreadProperty.name: // bc for older estree version
5958
case types.SpreadElement.name: {
6059
const resolvedValuePath = resolveToValue(propertyPath.get('argument'));
6160
switch (resolvedValuePath.node.type) {

src/utils/getPropType.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,7 @@ function getPropTypeShape(argumentPath) {
119119
if (types.ObjectExpression.check(argumentPath.node)) {
120120
const value = {};
121121
argumentPath.get('properties').each(function(propertyPath) {
122-
if (
123-
propertyPath.get('type').value === types.SpreadProperty.name || // bc for older estree version
124-
propertyPath.get('type').value === types.SpreadElement.name
125-
) {
122+
if (propertyPath.get('type').value === types.SpreadElement.name) {
126123
// It is impossible to resolve a name for a spread element
127124
return;
128125
}

src/utils/resolveObjectKeysToArray.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function resolveObjectExpressionToNameArray(
4040
(types.Property.check(prop) &&
4141
((types.Identifier.check(prop.key) && !prop.computed) ||
4242
types.Literal.check(prop.key))) ||
43-
(types.SpreadProperty.check(prop) || types.SpreadElement.check(prop)),
43+
types.SpreadElement.check(prop),
4444
)
4545
) {
4646
let values = [];
@@ -54,10 +54,7 @@ export function resolveObjectExpressionToNameArray(
5454
const name = prop.key.name || (raw ? prop.key.raw : prop.key.value);
5555

5656
values.push(name);
57-
} else if (
58-
types.SpreadProperty.check(prop) ||
59-
types.SpreadElement.check(prop)
60-
) {
57+
} else if (types.SpreadElement.check(prop)) {
6158
const spreadObject = resolveToValue(propPath.get('argument'));
6259
const spreadValues = resolveObjectExpressionToNameArray(spreadObject);
6360
if (!spreadValues) {

0 commit comments

Comments
 (0)