mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 00:20:28 +01:00
* Remove redundant initial of isArray (#21163) * Reapply prettier * Type the isArray function with refinement support This ensures that an argument gets refined just like it does if isArray is used directly. I'm not sure how to express with just a direct reference so I added a function wrapper and confirmed that this does get inlined properly by closure compiler. * A few more * Rename unit test to internal This is not testing a bundle. Co-authored-by: Behnam Mohammadi <itten@live.com>
20 lines
441 B
JavaScript
20 lines
441 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
declare function isArray(a: mixed): boolean %checks(Array.isArray(a));
|
|
|
|
const isArrayImpl = Array.isArray;
|
|
|
|
// eslint-disable-next-line no-redeclare
|
|
function isArray(a: mixed): boolean {
|
|
return isArrayImpl(a);
|
|
}
|
|
|
|
export default isArray;
|