Socket
Socket
Sign inDemoInstall

@availity/resolve-url

Package Overview
Dependencies
Maintainers
17
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@availity/resolve-url - npm Package Compare versions

Comparing version 1.1.21-alpha.21 to 1.1.21

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## 1.1.21 (2021-05-17)
### Bug Fixes
* **resolve-url:** fixes incorrect regex results failing tests, assign default param to baseIRI ([2aebb4b](https://github.com/Availity/sdk-js/commit/2aebb4b5ac512b8be1818a97914b84e6b734b1da))
## 1.1.20 (2020-06-22)

@@ -8,0 +19,0 @@

3

lib/is-absolute-url.js

@@ -12,4 +12,5 @@ "use strict";

throw new TypeError("Expected a `string`, got `".concat(typeof url, "`"));
}
} // eslint-disable-next-line unicorn/better-regex
return /^[a-z][a-z\d+.-]*:/.test(url);

@@ -16,0 +17,0 @@ };

@@ -84,3 +84,3 @@ "use strict";

// Query and fragment string should be appended unchanged
if (!segmentBuffers.length > 0) {
if (segmentBuffers.length === 0) {
segmentBuffers.push([]);

@@ -96,3 +96,3 @@ }

// Not a special character, just append it to our buffer
if (!segmentBuffers.length > 0) {
if (segmentBuffers.length === 0) {
segmentBuffers.push([]);

@@ -153,4 +153,4 @@ }

function resolve(relativeIRI, baseIRI) {
baseIRI = baseIRI || '';
function resolve(relativeIRI) {
var baseIRI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var baseFragmentPos = baseIRI.indexOf('#'); // Ignore any fragments in the base IRI

@@ -163,3 +163,3 @@

if (!relativeIRI.length > 0) {
if (relativeIRI.length === 0) {
return baseIRI;

@@ -185,3 +185,3 @@ } // If the value starts with a query character, concat directly (but strip the existing query)

if (!baseIRI.length > 0) {
if (baseIRI.length === 0) {
return removeDotSegmentsOfPath(relativeIRI, relativeIRI.indexOf(':'));

@@ -188,0 +188,0 @@ } // Ignore baseIRI if the value is absolute

{
"name": "@availity/resolve-url",
"version": "1.1.21-alpha.21+a2b3164",
"version": "1.1.21",
"description": "Resolve absolute url from relative urls",

@@ -21,3 +21,3 @@ "main": "lib/index.js",

},
"gitHead": "a2b31645b933229b33935f4ff16aa299ec4a25af"
"gitHead": "4e1d7493ccf0ba9e776476efc86088f4324618cd"
}
// Borrowed from https://github.com/sindresorhus/is-absolute-url to make IE11 compatible
const isAbsoluteUrl = url => {
const isAbsoluteUrl = (url) => {
if (typeof url !== 'string') {

@@ -7,2 +7,3 @@ throw new TypeError(`Expected a \`string\`, got \`${typeof url}\``);

// eslint-disable-next-line unicorn/better-regex
return /^[a-z][a-z\d+.-]*:/.test(url);

@@ -9,0 +10,0 @@ };

@@ -69,3 +69,3 @@ // Borrowed from https://github.com/rubensworks/relative-to-absolute-iri.js but refactored to work with IE11.

// Query and fragment string should be appended unchanged
if (!segmentBuffers.length > 0) {
if (segmentBuffers.length === 0) {
segmentBuffers.push([]);

@@ -79,3 +79,3 @@ }

// Not a special character, just append it to our buffer
if (!segmentBuffers.length > 0) {
if (segmentBuffers.length === 0) {
segmentBuffers.push([]);

@@ -89,3 +89,3 @@ }

return `/${segmentBuffers.map(buffer => buffer.join('')).join('/')}`;
return `/${segmentBuffers.map((buffer) => buffer.join('')).join('/')}`;
}

@@ -130,4 +130,3 @@

*/
export function resolve(relativeIRI, baseIRI) {
baseIRI = baseIRI || '';
export function resolve(relativeIRI, baseIRI = '') {
const baseFragmentPos = baseIRI.indexOf('#');

@@ -141,3 +140,3 @@

// Convert empty value directly to base IRI
if (!relativeIRI.length > 0) {
if (relativeIRI.length === 0) {
return baseIRI;

@@ -161,3 +160,3 @@ }

// Ignore baseIRI if it is empty
if (!baseIRI.length > 0) {
if (baseIRI.length === 0) {
return removeDotSegmentsOfPath(relativeIRI, relativeIRI.indexOf(':'));

@@ -164,0 +163,0 @@ }

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