import { getItemResources } from "@esri/arcgis-rest-portal";
/**
 * Given an item ID, and a resource name, check if the resource exists
 *
 * @param id Item ID
 * @param name Resource name
 * @param ro Request options
 * @returns boolean
 */
export async function doesResourceExist(id, name, ro) {
    return getItemResources(id, ro).then((resp) => {
        // if the resource exists, return true
        const foundResource = resp.resources.find((e) => {
            return e.resource === name;
        });
        return !!foundResource;
    });
}
//# sourceMappingURL=doesResourceExist.js.map