New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@ultraq/url-utils

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ultraq/url-utils

A collection of utilities for working with URLs

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

url-utils

Build Status Coverage Status npm Bundlephobia minified size

A collection of utilities for working with URLs.

Installation

Via npm:

npm install @ultraq/url-utils

API

join(...urlParts)

Concatenate several URL parts into a single string, inserting forward slashes between each part and taking care not to double-slash any parts. Useful for when the URL parts aren't known to include their respective slashes or not.

The first URL will retain any leading slash, and the last URL will retain any trailing slash.

  • urlParts: argument list of URL parts to combine

objectToSearchString(object)

Convert an object to a URL query parameter string, minus a leading ?.

  • object: Object whose key/value pairs are converted to key=value URL parameters, joined by &s.

searchStringToObject(searchString)

Convert URL query parameters to an object.

  • searchString: String where key=value is converted to object keys/values, pairs separated by &s and ignoring any leading ?.

Keywords

url

FAQs

Package last updated on 09 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts