diff options
Diffstat (limited to 'ui/lib/swatch/json.js')
| -rw-r--r-- | ui/lib/swatch/json.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/lib/swatch/json.js b/ui/lib/swatch/json.js new file mode 100644 index 0000000..3ebbc0d --- /dev/null +++ b/ui/lib/swatch/json.js @@ -0,0 +1,7 @@ +import { makeDeriver } from '$lib/swatch/derive.js'; + +export const decode = makeDeriver(JSON.parse); + +export function encode(value) { + return JSON.stringify(value, /* replacer */ null, /* space */ 2); +} |
