UNPKG

@sap-cloud-sdk/util

Version:

SAP Cloud SDK for JavaScript general utilities

18 lines 640 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkUrlExists = checkUrlExists; const axios_1 = __importDefault(require("axios")); /** * Checks whether a URL is existing via a head request. * @param url - URL to be checked. * @returns Promise - resolves if the URL exists. */ async function checkUrlExists(url) { return axios_1.default .request({ url, method: 'HEAD' }) .then(response => response.status); } //# sourceMappingURL=url.js.map