Promise-based
set / get / remove / clear / info / keys / clearExpired, all async/await; miss and expired resolve null instead of rejecting; unified StorageError carries errSubject / nativeErrCode / key
A full-featured local storage library for uni-app x
set / get / remove / clear / info / keys / clearExpired, all async/await; miss and expired resolve null instead of rejecting; unified StorageError carries errSubject / nativeErrCode / key
Record-wrapped timestamps with lazy checks on read (Date.now() > expire → removed); clearExpired sweeps and reports the removed count; three-level fallback: call-level ttl → instance defaultTTL → built-in never-expire
Default prefix mx_storage: avoids the reserved uni- / dcloud_ prefixes, invalid prefixes rejected with ERR_PARAM; keys() strips the prefix; clear only touches its own namespace
createStorage(defaults) creates instances with isolated prefix / TTL, mirroring axios.create; the default instance works out of the box, configureStorage sets global defaults
Foreign-format data (legacy entries written straight through native APIs) is returned as-is and treated as never-expiring — no errors, no accidental removal
Nullable-safe config fields (| null, null keeps built-in defaults), get
