feat: optional chaing
This commit is contained in:
committed by
Justin Ridgewell
parent
5cc1cbf3bc
commit
00f58b9bfa
@@ -0,0 +1 @@
|
||||
foo?.bar
|
||||
@@ -0,0 +1 @@
|
||||
typeof foo !== "undefined" && foo !== null ? foo.bar : null;
|
||||
@@ -0,0 +1 @@
|
||||
foo?.bar?.vroum
|
||||
@@ -0,0 +1 @@
|
||||
typeof (typeof foo !== "undefined" && foo !== null ? foo.bar : null) !== "undefined" && (typeof foo !== "undefined" && foo !== null ? foo.bar : null) !== null ? foo.bar.vroum : null;
|
||||
3
packages/babel-plugin-transform-optional-chaining/test/fixtures/general/options.json
vendored
Normal file
3
packages/babel-plugin-transform-optional-chaining/test/fixtures/general/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["transform-optional-chaining"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import runner from "babel-helper-plugin-test-runner";
|
||||
|
||||
runner(__dirname);
|
||||
Reference in New Issue
Block a user