Skip to content

⬅️ Back to Table of Contents

πŸ“„ ast-utils/predicates

πŸ“Š Analysis Summary

Metric Count
πŸ”§ Functions 1
πŸ“¦ Imports 8
πŸ“Š Variables & Constants 2

πŸ“š Table of Contents

πŸ› οΈ File Location:

πŸ“‚ packages/utils/src/ast-utils/predicates.ts

πŸ“¦ Imports

Name Source
TSESTree ../ts-estree
AST_NODE_TYPES ../ts-estree
AST_TOKEN_TYPES ../ts-estree
isNodeOfType ./helpers
isNodeOfTypes ./helpers
isNodeOfTypeWithConditions ./helpers
isNotTokenOfTypeWithConditions ./helpers
isTokenOfTypeWithConditions ./helpers

Variables & Constants

Name Type Kind Value Exported
functionTypes readonly [any, any, any] const [ AST_NODE_TYPES.ArrowFunctionExpression, AST_NODE_TYPES.FunctionDeclaration,... βœ—
functionTypeTypes readonly [any, any, any, any, any, an... const [ AST_NODE_TYPES.TSCallSignatureDeclaration, AST_NODE_TYPES.TSConstructorType... βœ—

Functions

isSetter(node: TSESTree.Node | undefined): node is { kind: 'set' } & (TSESTree.MethodDefinition | TSES…

Checks if a node is a setter method.

Raw JSDoc
/**
 * Checks if a node is a setter method.
 */
Code
export function isSetter(
  node: TSESTree.Node | undefined,
): node is { kind: 'set' } & (TSESTree.MethodDefinition | TSESTree.Property) {
  return (
    !!node &&
    (node.type === AST_NODE_TYPES.MethodDefinition ||
      node.type === AST_NODE_TYPES.Property) &&
    node.kind === 'set'
  );
}

Generated by Syntax Scribe