CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel--helper-module-imports

Babel helper functions for inserting module loads

Overall
score

99%

Overview
Eval results
Files

task.mdevals/scenario-2/

AST Node Type Analyzer

A utility that analyzes JavaScript Abstract Syntax Tree (AST) nodes and provides information about their types and characteristics.

Capabilities

Basic Node Type Validation

  • Returns true when checking if a node with type "Identifier" is an identifier @test
  • Returns false when checking if a node with type "NumericLiteral" is an identifier @test
  • Returns true when checking if a function declaration node is a statement @test

Expression Type Detection

  • Returns true when checking if a binary expression node is an expression @test
  • Returns false when checking if a variable declaration is an expression @test

Type Classification with Aliases

  • Returns true when checking if an if statement is a conditional statement @test
  • Returns true when checking if a variable declaration is a declaration @test

Implementation

@generates

API

/**
 * Checks if the given AST node is an identifier.
 *
 * @param {Object} node - The AST node to check
 * @returns {boolean} True if the node is an identifier, false otherwise
 */
function isIdentifier(node) {
  // IMPLEMENTATION HERE
}

/**
 * Checks if the given AST node is an expression.
 *
 * @param {Object} node - The AST node to check
 * @returns {boolean} True if the node is an expression, false otherwise
 */
function isExpression(node) {
  // IMPLEMENTATION HERE
}

/**
 * Checks if the given AST node is a statement.
 *
 * @param {Object} node - The AST node to check
 * @returns {boolean} True if the node is a statement, false otherwise
 */
function isStatement(node) {
  // IMPLEMENTATION HERE
}

/**
 * Checks if the given AST node is a declaration.
 *
 * @param {Object} node - The AST node to check
 * @returns {boolean} True if the node is a declaration, false otherwise
 */
function isDeclaration(node) {
  // IMPLEMENTATION HERE
}

/**
 * Checks if the given AST node is a conditional statement (if, switch, conditional expression).
 *
 * @param {Object} node - The AST node to check
 * @returns {boolean} True if the node is a conditional statement, false otherwise
 */
function isConditional(node) {
  // IMPLEMENTATION HERE
}

module.exports = {
  isIdentifier,
  isExpression,
  isStatement,
  isDeclaration,
  isConditional
};

Dependencies { .dependencies }

@babel/types { .dependency }

Provides AST node type checking and validation utilities.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-babel--helper-module-imports

tile.json