'use strict';constpath=require('path');functionisUrlRequest(url,root){// An URL is not an request if// 1. It's an absolute url and it is not `windows` path like `C:\dir\file`if(/^[a-z][a-z0-9+.-]*:/i.test(url)&&!path.win32.isAbsolute(url)){returnfalse;}// 2. It's a protocol-relativeif(/^\/\//.test(url)){returnfalse;}// 3. It's some kind of url for a templateif(/^[{}[\]#*;,'§$%&(=?`´^°<>]/.test(url)){returnfalse;}// 4. It's also not an request if root isn't set and it's a root-relative urlif((root===undefined||root===false)&&/^\//.test(url)){returnfalse;}returntrue;}module.exports=isUrlRequest;