UNPKG

hta

Version:

The tiny framework for building Hyper Text Application with ease

18 lines (16 loc) 400 B
import { LOADABLE } from "../core/types"; import { isArray } from "../core/util"; export default function valueOf(loadable) { if (isArray(loadable)) { return loadable.map((item) => { if (item && item.type === LOADABLE) { return item.value; } return item; }); } if (loadable && loadable.type === LOADABLE) { return loadable.value; } return loadable; }