UNPKG

remix-utils-rt

Version:

This package contains simple utility functions to use with [React Router](https://reactrouter.com/home).

17 lines 542 B
import { data } from "react-router"; export async function jsonHash(input, init) { let result = {}; let resolvedResults = await Promise.all(Object.entries(input).map(async ([key, value]) => { if (value instanceof Function) value = value(); if (value instanceof Promise) value = await value; return [key, value]; })); for (let [key, value] of resolvedResults) { result[key] = value; } return data(result, init); } //# sourceMappingURL=json-hash.js.map