Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ufo

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ufo - npm Package Compare versions

Comparing version 0.6.6 to 0.6.7

12

CHANGELOG.md

@@ -5,2 +5,14 @@ # Changelog

### [0.6.7](https://github.com/nuxt-contrib/ufo/compare/v0.6.6...v0.6.7) (2021-02-22)
### Features
* isEmptyURL and isNonEmptyURL utils ([3c1c6d8](https://github.com/nuxt-contrib/ufo/commit/3c1c6d8ec83518805b451ffd76c49210acbb1a29))
### Bug Fixes
* **joinURL, resolveURL:** ignore empty url parts ([c5fd74d](https://github.com/nuxt-contrib/ufo/commit/c5fd74d9bc3311a44e1be0635e7a4e62a7aea416))
### [0.6.6](https://github.com/nuxt-contrib/ufo/compare/v0.6.5...v0.6.6) (2021-02-10)

@@ -7,0 +19,0 @@

4

dist/index.d.ts

@@ -129,2 +129,4 @@ /**

declare function getQuery(input: string): QueryObject;
declare function isEmptyURL(url: string): boolean;
declare function isNonEmptyURL(url: string): boolean | "";
declare function joinURL(base: string, ...input: string[]): string;

@@ -136,2 +138,2 @@ declare function createURL(input: string): $URL;

export { $URL, ParsedAuth, ParsedHost, ParsedURL, QueryObject, QueryValue, cleanDoubleSlashes, createURL, decode, decodeQueryValue, encode, encodeHash, encodeHost, encodeParam, encodePath, encodeQueryItem, encodeQueryKey, encodeQueryValue, getQuery, hasLeadingSlash, hasProtocol, hasTrailingSlash, isSamePath, joinURL, normalizeURL, parseAuth, parseHost, parsePath, parseQuery, parseURL, resolveURL, stringifyParsedURL, stringifyQuery, withBase, withLeadingSlash, withQuery, withTrailingSlash, withoutBase, withoutLeadingSlash, withoutTrailingSlash };
export { $URL, ParsedAuth, ParsedHost, ParsedURL, QueryObject, QueryValue, cleanDoubleSlashes, createURL, decode, decodeQueryValue, encode, encodeHash, encodeHost, encodeParam, encodePath, encodeQueryItem, encodeQueryKey, encodeQueryValue, getQuery, hasLeadingSlash, hasProtocol, hasTrailingSlash, isEmptyURL, isNonEmptyURL, isSamePath, joinURL, normalizeURL, parseAuth, parseHost, parsePath, parseQuery, parseURL, resolveURL, stringifyParsedURL, stringifyQuery, withBase, withLeadingSlash, withQuery, withTrailingSlash, withoutBase, withoutLeadingSlash, withoutTrailingSlash };

@@ -286,3 +286,3 @@ 'use strict';

function withBase(input, base) {
if (!base || base === "/") {
if (isEmptyURL(base)) {
return input;

@@ -297,3 +297,3 @@ }

function withoutBase(input, base) {
if (!base || base === "/") {
if (isEmptyURL(base)) {
return input;

@@ -316,9 +316,13 @@ }

}
function isEmptyURL(url2) {
return !url2 || url2 === "/";
}
function isNonEmptyURL(url2) {
return url2 && url2 !== "/";
}
function joinURL(base, ...input) {
let url2 = base || "";
for (const i of input) {
for (const i of input.filter(isNonEmptyURL)) {
const part = withoutLeadingSlash(i);
if (part !== "/") {
url2 = withTrailingSlash(url2) + part;
}
url2 = withTrailingSlash(url2) + part;
}

@@ -335,3 +339,3 @@ return url2;

const url2 = createURL(base);
for (const i of input) {
for (const i of input.filter(isNonEmptyURL)) {
url2.append(createURL(i));

@@ -408,2 +412,4 @@ }

exports.hasTrailingSlash = hasTrailingSlash;
exports.isEmptyURL = isEmptyURL;
exports.isNonEmptyURL = isNonEmptyURL;
exports.isSamePath = isSamePath;

@@ -410,0 +416,0 @@ exports.joinURL = joinURL;

{
"name": "ufo",
"version": "0.6.6",
"version": "0.6.7",
"description": "URL utils for humans",

@@ -5,0 +5,0 @@ "repository": "nuxt-contrib/ufo",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc