From 98487b5a15c222dd7e7fd0bc4732bfcaaeac9670 Mon Sep 17 00:00:00 2001 From: Sven SAULEAU Date: Mon, 29 May 2017 18:58:27 +0200 Subject: [PATCH] fix: typo --- .../src/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/babel-plugin-transform-optional-chaining/src/index.js b/packages/babel-plugin-transform-optional-chaining/src/index.js index 75fff8aabc..77a6a20ff2 100644 --- a/packages/babel-plugin-transform-optional-chaining/src/index.js +++ b/packages/babel-plugin-transform-optional-chaining/src/index.js @@ -62,7 +62,7 @@ export default function ({ types: t }) { ); // FIXME(sven): if will be a ConditionalExpression for childs, only top level will be ifStatement - const remplacement = t.ifStatement(isChainNil, t.blockStatement([t.expressionStatement(path.node)])); + const replacement = t.ifStatement(isChainNil, t.blockStatement([t.expressionStatement(path.node)])); setOptionalTransformed(left); @@ -72,7 +72,7 @@ export default function ({ types: t }) { }, }); - path.parentPath.replaceWith(remplacement); + path.parentPath.replaceWith(replacement); }, UnaryExpression(path, state) { @@ -106,11 +106,11 @@ export default function ({ types: t }) { nilIdentifier, ); - const remplacement = t.ifStatement(isChainNil, t.blockStatement([t.expressionStatement(path.node)])); + const replacement = t.ifStatement(isChainNil, t.blockStatement([t.expressionStatement(path.node)])); setOptionalTransformed(argument); - path.parentPath.replaceWith(remplacement); + path.parentPath.replaceWith(replacement); }, MemberExpression(path, state) { @@ -133,7 +133,7 @@ export default function ({ types: t }) { return; } else if (t.isCallExpression(path.parent)) { - const remplacement = createCondition( + const replacement = createCondition( state.optionalTemp, object, property, @@ -141,10 +141,10 @@ export default function ({ types: t }) { ); setOptionalTransformed(path.node); - path.replaceWith(remplacement); + path.replaceWith(replacement); } else { - const remplacement = createCondition( + const replacement = createCondition( state.optionalTemp, object, property, @@ -152,7 +152,7 @@ export default function ({ types: t }) { ); setOptionalTransformed(path.node); - path.replaceWith(remplacement); + path.replaceWith(replacement); } }, },