CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-aws-sdk--client-sts

AWS SDK for JavaScript STS Client for Node.js, Browser and React Native, providing temporary security credentials and role assumption capabilities

92

1.05x

Evaluation92%

1.05x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-1/

User Profile Data Converter

A utility library for converting user profile data between standard JavaScript format and a specialized storage format used by the database system.

Capabilities

Converts user profiles to storage format

  • Given a user profile object {id: "user123", name: "Alice", age: 30, active: true}, it converts to the specialized storage format required by the database. @test
  • Given a user profile with nested data {id: "user456", name: "Bob", metadata: {tags: ["admin", "verified"], score: 95.5}}, it converts all nested fields including arrays and nested objects to the storage format. @test

Converts storage format to user profiles

  • Given data in storage format, it converts back to a standard JavaScript object with proper types (strings, numbers, booleans, objects, arrays). @test
  • Given storage format with nested structures, it converts all nested fields back to standard JavaScript types. @test

Handles edge cases in conversion

  • Given an object with undefined values {id: "user789", name: "Charlie", email: undefined}, it removes undefined values during conversion to storage format. @test
  • Given an object with empty strings {id: "user999", name: "", bio: ""}, it properly converts empty strings during the conversion process. @test

Implementation

@generates

API

/**
 * Converts a JavaScript object representing a user profile into storage format.
 * Handles all standard JavaScript types including strings, numbers, booleans, objects, and arrays.
 * Removes undefined values from the object.
 *
 * @param {Object} profile - The user profile object to convert
 * @returns {Object} The profile in storage format
 */
function convertToStorage(profile) {
  // IMPLEMENTATION HERE
}

/**
 * Converts a storage format object back into a standard JavaScript object.
 * Handles all storage format types and nested structures.
 *
 * @param {Object} storageData - The storage format data to convert
 * @returns {Object} The standard JavaScript object
 */
function convertFromStorage(storageData) {
  // IMPLEMENTATION HERE
}

module.exports = {
  convertToStorage,
  convertFromStorage,
};

Dependencies { .dependencies }

@aws-sdk/util-dynamodb { .dependency }

Provides utilities for converting between JavaScript and database storage formats.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-aws-sdk--client-sts

tile.json