jefer94/choco

View on GitHub
services/cache/src/actions/setObject.ts

Summary

Maintainability
A
0 mins
Test Coverage
import set from './set'

type SetObject = {
  readonly data?: {
    readonly key: string
    readonly value: string
  }
  readonly error?: string
}

export default function setObject<T>(key: string, value: T): Promise<SetObject> {
  const json = JSON.stringify(value)
  return set(key, json)
}