Skip to content

Commit 6e11ffe

Browse files
committed
fix: fix bad typo mistake in node-env-condition
1 parent a21bef3 commit 6e11ffe

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/transformers/node-env-condition.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ function nodeEnvCheck(exp, _nodeEnv) {
7979
let targetValue;
8080
let possibleRef;
8181
if (left.type === 'Literal') {
82-
targetValue === left.value;
83-
possibleRef === right;
82+
targetValue = left.value;
83+
possibleRef = right;
8484
} else if (right.type === 'Literal') {
8585
targetValue = right.value;
8686
possibleRef = left;

test/transformers/node-env-condition.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ foo(function() {
6868
test('nodeEnvCondition retains consequent branch in if-else condition', t => {
6969
const contents = `import foo from './foo';
7070
foo(function() {
71-
if (process.env.NODE_ENV == 'production') {
71+
if ('production' == process.env.NODE_ENV) {
7272
this.production();
7373
} else {
7474
this.debugger();
@@ -94,7 +94,7 @@ foo(function() {
9494
test('nodeEnvCondition retains alternate branch in if-else condition', t => {
9595
const contents = `import foo from './foo';
9696
foo(function() {
97-
if (process.env["NODE_ENV"] == 'production') {
97+
if ('production' == process.env["NODE_ENV"]) {
9898
this.production();
9999
} else {
100100
this.debugger();

0 commit comments

Comments
 (0)