import { getItemData } from "@esri/arcgis-rest-portal";
import { shouldFetchData } from "../content/_internal/shouldFetchData";
/**
 * Given an Item, fetch the data json and return an IModel
 * @param item
 * @param requestOptions
 * @returns
 */
export async function fetchModelFromItem(item, requestOptions) {
    const data = shouldFetchData(item)
        ? (await getItemData(item.id, requestOptions).catch(() => null))
        : null;
    return {
        item,
        data,
    };
}
//# sourceMappingURL=fetchModelFromItem.js.map