tessl install tessl/npm-store@2.0.0A localStorage wrapper for all browsers without using cookies or flash, providing persistent client-side storage with automatic fallback and plugin architecture
Agent Success
Agent success rate when using this tile
75%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.96x
Baseline
Agent success rate without this tile
78%
Build a storage migration utility that helps applications transition from store.js v1.x to v2.x by providing a compatibility layer that supports both API styles.
Your utility should provide a storage interface that:
Supports v1-style direct property access: Allow reading and writing values using direct property syntax (e.g., store.username = 'alice' and var name = store.username)
Handles v1-style transact method: Implement a transaction method that accepts a key and a function. The function receives the current value and returns the new value. This should work for creating, updating, and removing values (return undefined to remove).
Supports v1-style getAll method: Provide a method that returns all stored key-value pairs as a plain JavaScript object.
Supports v1-style serialize and deserialize: Allow custom serialization and deserialization functions to be configured. These should be used for all storage operations.
Maintains modern v2 API compatibility: Ensure that standard v2 methods (get, set, remove, clearAll) continue to work alongside the v1-style API.
store.key = 'value') stores it correctly and can be retrieved using property access @testundefined @testtransact method updates an existing value by passing it through a transformation function @testtransact method creates a new value when the key doesn't exist and the function returns a value @testgetAll method returns all stored key-value pairs as a plain object @test@generates
/**
* Creates a storage instance with v1 backwards compatibility
* @returns {Object} Storage interface supporting both v1 and v2 APIs
*/
function createLegacyStorage() {
// Implementation
}
module.exports = { createLegacyStorage };Provides cross-browser local storage with plugin support for backwards compatibility.
@satisfied-by