Deterministic and safely JSON.stringify to quickly serialize JavaScript objects
90
Evaluation — 90%
↑ 1.08xAgent success when using this tile
A utility that serializes application configuration objects to JSON strings for logging purposes. The utility must handle various JavaScript value types and support custom formatting options.
{name: "app", version: 1} to the JSON string '{"name":"app","version":1}' @test[1, 2, 3] to the JSON string '[1,2,3]' @test@generates
/**
* Serializes a configuration object to a JSON string.
*
* @param {*} value - The value to serialize
* @param {Function|Array|null} [replacer] - Optional replacer function or array
* @param {number|string} [space] - Optional spacing for formatting
* @returns {string} The serialized JSON string
*/
function serializeConfig(value, replacer, space) {
// IMPLEMENTATION HERE
}
module.exports = { serializeConfig };Provides JSON serialization with safe defaults and compatibility with standard JSON.stringify API.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-safe-stable-stringifydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10