docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a data pipeline processor that transforms and filters collections of data using iterator-based patterns.
Your task is to implement a data processor that:
id, name, age, and score properties)/**
* Creates a data pipeline processor
*
* @param {Array} data - Array of user records
* @returns {Object} Pipeline builder with chainable methods
*/
function createPipeline(data) {
// IMPLEMENTATION HERE
}
/**
* Example usage:
* const pipeline = createPipeline(users)
* .filterByAge(18)
* .selectFields(['id', 'name'])
* .sortBy('name');
*
* // Can be used with for...of
* for (const user of pipeline) {
* console.log(user);
* }
*
* // Can be spread
* const results = [...pipeline];
*/
module.exports = { createPipeline };Provides utility functions for data manipulation and chaining support.