utils for network
npm install @hint/utils-network@hint/utils-network)Set of helpers for network.
This package is installed automatically when adding webhint to your project
so running the following is enough:
``bash`
npm install hint --save-dev
* asPathString: Returns the pathname of a URL, normalizing dependinggetAsUri
on the platform.
* : Receives a string and returns a valid UrisgetAsUris
* : Receives an array of string and returns an array of valid Uris.hasProtocol
* : Convenience function to check if a resource uses a specificincludedHeaders
protocol.
* : Returns a list of all the headers in headerListheaders
that are in sorted alphabetically.isDataURI
* : Convenience function to check if a resource is a data URI.isHTMLDocument
* : Convenience function to check if a resource is aisHTTP
HTMLDocument.
* : Convenience function to check if a resource is served over HTTP.isHTTPS
* : Convenience function to check if a resource is served over HTTPS.isLocalFile
* : Convenience function to check if a resource is a local file.isRegularProtocol
* : Convenience function to check if a uri's protocolnormalizeHeaderValue
is http/https if specified.
* : Remove whitespace from both ends of a header valuerequestAsync
and lowercase it.
* : Convenience wrapper for asynchronously request an URL.requestJSONAsync
* : Request response in the json format from an endpoint.rxLocalhost
* : RegExp to test if a resource points to localhost.rxLocalFile`: RegExp to test if a resource is loaded from a local file.
*