How to use the isTSMethodSignature function from @babel/types

Find comprehensive JavaScript @babel/types.isTSMethodSignature code examples handpicked from public code repositorys.

48
49
50
51
52
53
54
55
56
57

if (comment.kind === 'class' && comment.hideconstructor) {
  return comment;
}

let params = t.isTSMethodSignature(path)
  ? path.node.parameters
  : path.node.params;

// Flow function annotations separate rest parameters into a different list
fork icon510
star icon0
watch icon5

+ 7 other calls in file

23
24
25
26
27
28
29
30
31
32
} else if (
  t.isFunction(node) ||
  t.isTSDeclareMethod(node) ||
  t.isTSDeclareFunction(node) ||
  t.isFunctionTypeAnnotation(node) ||
  t.isTSMethodSignature(node)
) {
  if (node.kind === 'get' || node.kind === 'set') {
    comment.kind = 'member';
  } else if (node.id && node.id.name && !!/^[A-Z]/.exec(node.id.name)) {
fork icon509
star icon0
watch icon0

+ 20 other calls in file

102
103
104
105
106
107
108
109
110
111
112
}


function findFunction(funcs, n) {
	if (funcs.factory) {
		let func = funcs.factory.body.find(
			(f) => t.isTSMethodSignature(f) && f.key.name === n
		);
		return {
			params: func.parameters,
			returnType: func.typeAnnotation.typeAnnotation.typeName.name,
fork icon0
star icon0
watch icon0

+ 3 other calls in file

Other functions in @babel/types

Sorted by popularity

function icon

@babel/types.identifier is the most popular function in @babel/types (20936 examples)