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-4/

Array Combiner

A utility library for merging parallel arrays element-by-element using custom operations.

Capabilities

Merge arrays element-by-element with custom operation

Merges multiple arrays by applying a custom function to corresponding elements from each array at the same position.

  • Given arrays [1, 2], [3, 4], and [5, 6] with a sum operation (a, b, c) => a + b + c, returns [9, 12] @test
  • Given arrays ['a', 'b'] and ['c', 'd'] with a concatenation operation (x, y) => x + y, returns ['ac', 'bd'] @test
  • Given empty arrays [] and [] with any operation, returns an empty array [] @test

Reverse the merge operation on grouped data

Takes an array where each element is itself an array, and applies a function across corresponding positions to produce aggregated results.

  • Given grouped data [[1, 3, 5], [2, 4, 6]] with a sum operation (...nums) => nums.reduce((a, b) => a + b, 0), returns [9, 12] @test
  • Given an empty grouped array [] with any operation, returns an empty array [] @test

Implementation

@generates

API

/**
 * Merges multiple arrays element-by-element using a custom operation.
 * Takes N arrays plus a function, and applies the function to elements
 * at the same index across all arrays.
 *
 * @param {...Array} arrays - Two or more arrays to merge
 * @param {Function} operation - Function that takes N arguments (one from each array) and returns a single value
 * @returns {Array} Array of merged values
 */
function mergeArrays(...arrays) {
  // IMPLEMENTATION HERE
}

/**
 * Reverses a merge operation by applying a function across corresponding
 * positions in grouped data. Takes an array of arrays and applies the
 * function to elements at each position.
 *
 * @param {Array} grouped - Array where each element is an array of values
 * @param {Function} operation - Function that receives all values at a position and returns a single result
 * @returns {Array} Array of aggregated results, one per position
 */
function unmergeGrouped(grouped, operation) {
  // IMPLEMENTATION HERE
}

module.exports = {
  mergeArrays,
  unmergeGrouped,
};

Dependencies { .dependencies }

lodash { .dependency }

Provides array manipulation utilities including element-wise combination and splitting operations.