Ctrl + k

or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/lodash.unescape@4.0.x
tile.json

tessl/npm-lodash-unescape

tessl install tessl/npm-lodash-unescape@4.0.0

Converts HTML entities to their corresponding characters in a string

Agent Success

Agent success rate when using this tile

85%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.39x

Baseline

Agent success rate without this tile

61%

task.mdevals/scenario-10/

User Search Utility

A utility library for searching and filtering user data collections.

Capabilities

Find user by ID

  • Given an array of user objects and a user ID, returns the user object with that ID @test
  • Returns undefined when no user with the given ID exists @test

Find user by custom criteria

  • Given an array of users and a predicate function, returns the first user matching the criteria @test
  • Returns undefined when no user matches the predicate @test

Check if user exists

  • Given an array of user IDs and a specific ID, returns true if the ID exists in the array @test
  • Returns false if the ID does not exist in the array @test

Get user position

  • Given an array of user IDs and a specific ID, returns the index position of that ID @test
  • Returns -1 when the ID is not found in the array @test

Implementation

@generates

API

/**
 * Finds a user by their ID in an array of user objects.
 *
 * @param {Array} users - Array of user objects
 * @param {number} userId - The ID to search for
 * @returns {Object|undefined} The user object if found, undefined otherwise
 */
function findUserById(users, userId) {
  // IMPLEMENTATION HERE
}

/**
 * Finds the first user matching a custom predicate function.
 *
 * @param {Array} users - Array of user objects
 * @param {Function} predicate - Function that returns true for matching user
 * @returns {Object|undefined} The first matching user object if found, undefined otherwise
 */
function findUserByPredicate(users, predicate) {
  // IMPLEMENTATION HERE
}

/**
 * Checks if a user ID exists in an array of user IDs.
 *
 * @param {Array} userIds - Array of user IDs
 * @param {number} searchId - The ID to check for
 * @returns {boolean} True if the ID exists, false otherwise
 */
function userExists(userIds, searchId) {
  // IMPLEMENTATION HERE
}

/**
 * Gets the index position of a user ID in an array.
 *
 * @param {Array} userIds - Array of user IDs
 * @param {number} searchId - The ID to find the position of
 * @returns {number} The index position if found, -1 otherwise
 */
function getUserPosition(userIds, searchId) {
  // IMPLEMENTATION HERE
}

module.exports = {
  findUserById,
  findUserByPredicate,
  userExists,
  getUserPosition,
};

Dependencies { .dependencies }

lodash { .dependency }

Provides utility functions for array searching and manipulation.