@xapp/arachne-utils
Version:
22 lines • 522 B
JavaScript
;
/*! Copyright (c) 2024, XAPP AI */
Object.defineProperty(exports, "__esModule", { value: true });
exports.isValidURL = void 0;
/**
* Determines if the URL is a valid URL.
*
* It attempts to create a new URL object from the string and returns true if it is successful.
* @param url
* @returns
*/
const isValidURL = (url) => {
try {
new URL(url);
return true;
}
catch (e) {
return false;
}
};
exports.isValidURL = isValidURL;
//# sourceMappingURL=isValidURL.js.map