url-toolkit
Advanced tools
Comparing version 2.2.1 to 2.2.2
{ | ||
"name": "url-toolkit", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Build an absolute URL from a base URL and a relative URL (RFC 1808). No dependencies!", | ||
@@ -5,0 +5,0 @@ "main": "src/url-toolkit.js", |
[![npm version](https://badge.fury.io/js/url-toolkit.svg)](https://badge.fury.io/js/url-toolkit) | ||
[![Build Status](https://travis-ci.org/tjenkinson/url-toolkit.svg?branch=master)](https://travis-ci.org/tjenkinson/url-toolkit) | ||
@@ -4,0 +3,0 @@ # URL Toolkit |
// see https://tools.ietf.org/html/rfc1808 | ||
(function (root) { | ||
var URL_REGEX = /^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#.*)?$/; | ||
var FIRST_SEGMENT_REGEX = /^([^\/?#]*)(.*)$/; | ||
var URL_REGEX = /^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/; | ||
var FIRST_SEGMENT_REGEX = /^([^\/?#]*)([^]*)$/; | ||
var SLASH_DOT_REGEX = /(?:\/|^)\.(?=\/)/g; | ||
@@ -7,0 +7,0 @@ var SLASH_DOT_DOT_REGEX = /(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g; |
@@ -296,2 +296,4 @@ const assert = require('assert'); | ||
test('http://[0:0:0:0::0]/a/b.c', 'd', 'http://[0:0:0:0::0]/a/d'); | ||
test('http://example.com/', 'a#\nb', 'http://example.com/a#\nb'); | ||
}); | ||
@@ -298,0 +300,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
478
33732
91