add some more flow types
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
/* @noflow */
|
||||
|
||||
import isPlainObject from "lodash/lang/isPlainObject";
|
||||
import isNumber from "lodash/lang/isNumber";
|
||||
import isRegExp from "lodash/lang/isRegExp";
|
||||
@@ -218,7 +220,7 @@ export function toExpression(node: Object): Object {
|
||||
}
|
||||
}
|
||||
|
||||
export function toBlock(node, parent: Object): Object {
|
||||
export function toBlock(node: Object, parent: Object): Object {
|
||||
if (t.isBlockStatement(node)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* @flow */
|
||||
|
||||
import * as t from "./index";
|
||||
|
||||
/**
|
||||
@@ -19,7 +21,7 @@ export function createUnionTypeAnnotation(types: Array<Object>) {
|
||||
* Dedupe type annotations.
|
||||
*/
|
||||
|
||||
export function removeTypeDuplicates(nodes: Array<Object>) {
|
||||
export function removeTypeDuplicates(nodes: Array<Object>): Array<Object> {
|
||||
let generics = {};
|
||||
let bases = {};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* @noflow */
|
||||
/* @flow */
|
||||
|
||||
import toFastProperties from "to-fast-properties";
|
||||
import compact from "lodash/array/compact";
|
||||
@@ -406,6 +406,7 @@ export function inherits(child: Object, parent: Object): Object {
|
||||
|
||||
export function assertNode(node?) {
|
||||
if (!isNode(node)) {
|
||||
// $FlowFixMe
|
||||
throw new TypeError("Not a valid node " + (node && node.type));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* @flow */
|
||||
|
||||
import { getBindingIdentifiers } from "./retrievers";
|
||||
import esutils from "esutils";
|
||||
import * as t from "./index";
|
||||
@@ -67,7 +69,7 @@ export function isReferenced(node: Object, parent: Object): boolean {
|
||||
case "ArrowFunctionExpression":
|
||||
case "FunctionDeclaration":
|
||||
case "FunctionExpression":
|
||||
for (let param of (parent.params: Array)) {
|
||||
for (let param of (parent.params: Array<any>)) {
|
||||
if (param === node) return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user