From ee8c6204de6aac61a646e25fe700ae8d1f939b7f Mon Sep 17 00:00:00 2001 From: Kuba Juszczyk Date: Thu, 25 Jul 2019 22:53:33 +0200 Subject: [PATCH 1/4] Optimize objectIs Native Object.is implementation is much faster than polyfill. --- packages/shared/objectIs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/objectIs.js b/packages/shared/objectIs.js index 3110e3fa5a9ca..68a756f38d91e 100644 --- a/packages/shared/objectIs.js +++ b/packages/shared/objectIs.js @@ -17,4 +17,4 @@ function is(x: any, y: any) { ); } -export default is; +export default typeof Object.is === 'function' ? Object.is : is; From cc7faf56a4a94112875d69fc4d17aad69d6f1387 Mon Sep 17 00:00:00 2001 From: Kuba Juszczyk Date: Thu, 25 Jul 2019 23:00:35 +0200 Subject: [PATCH 2/4] fix linter --- packages/shared/objectIs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/shared/objectIs.js b/packages/shared/objectIs.js index 68a756f38d91e..3e15eaa9dfb0b 100644 --- a/packages/shared/objectIs.js +++ b/packages/shared/objectIs.js @@ -17,4 +17,6 @@ function is(x: any, y: any) { ); } -export default typeof Object.is === 'function' ? Object.is : is; +export default typeof Object.is === 'function' + ? Object.is + : is; From a7e303235e90fad243a04a36d48875d7a2bbb801 Mon Sep 17 00:00:00 2001 From: Kuba Juszczyk Date: Thu, 25 Jul 2019 23:20:59 +0200 Subject: [PATCH 3/4] fix prettier --- packages/shared/objectIs.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/shared/objectIs.js b/packages/shared/objectIs.js index 3e15eaa9dfb0b..345b5150b5a76 100644 --- a/packages/shared/objectIs.js +++ b/packages/shared/objectIs.js @@ -17,6 +17,4 @@ function is(x: any, y: any) { ); } -export default typeof Object.is === 'function' - ? Object.is - : is; +export default typeof Object.is === 'function' ? Object.is : is; From f4cbdc73a2d3b60ab3297298dbfdc664fce78445 Mon Sep 17 00:00:00 2001 From: Kuba Juszczyk Date: Thu, 25 Jul 2019 23:28:04 +0200 Subject: [PATCH 4/4] fix linting (again) --- packages/shared/objectIs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/objectIs.js b/packages/shared/objectIs.js index 345b5150b5a76..877ec6572682f 100644 --- a/packages/shared/objectIs.js +++ b/packages/shared/objectIs.js @@ -17,4 +17,4 @@ function is(x: any, y: any) { ); } -export default typeof Object.is === 'function' ? Object.is : is; +export default (typeof Object.is === 'function' ? Object.is : is);