Files
kener/scripts/tool.js
T
2023-12-09 20:22:47 +05:30

8 lines
246 B
JavaScript

const IsValidURL = function (url) {
return /^(http|https):\/\/[^ "]+$/.test(url);
};
const IsValidHTTPMethod = function (method) {
return /^(GET|POST|PUT|DELETE|HEAD|OPTIONS|PATCH)$/.test(method);
}
export { IsValidURL, IsValidHTTPMethod };