whatwg-url
Advanced tools
Comparing version 8.7.0 to 9.0.0
"use strict"; | ||
let { TextEncoder, TextDecoder } = require("util"); | ||
// Handle browserify's lack of support (https://github.com/browserify/node-util/issues/46), which | ||
// is important for the live viewer: | ||
if (!TextEncoder) { | ||
TextEncoder = global.TextEncoder; | ||
} | ||
if (!TextDecoder) { | ||
TextDecoder = global.TextDecoder; | ||
} | ||
const utf8Encoder = new TextEncoder(); | ||
@@ -13,0 +3,0 @@ const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true }); |
@@ -32,6 +32,3 @@ "use strict"; | ||
// TODO: remove the Buffer.from in the next major version; it's only needed for back-compat, and sticking to standard | ||
// typed arrays is nicer and simpler. | ||
// See https://github.com/jsdom/data-urls/issues/17 for background. | ||
return Buffer.from(output.slice(0, outputIndex)); | ||
return output.slice(0, outputIndex); | ||
} | ||
@@ -38,0 +35,0 @@ |
"use strict"; | ||
const punycode = require("punycode"); | ||
const tr46 = require("tr46"); | ||
@@ -172,3 +171,3 @@ | ||
input = punycode.ucs2.decode(input); | ||
input = Array.from(input, c => c.codePointAt(0)); | ||
@@ -498,3 +497,3 @@ if (input[pointer] === 58) { | ||
this.input = punycode.ucs2.decode(this.input); | ||
this.input = Array.from(this.input, c => c.codePointAt(0)); | ||
@@ -501,0 +500,0 @@ for (; this.pointer <= this.input.length; ++this.pointer) { |
"use strict"; | ||
const stableSortBy = require("lodash/sortBy"); | ||
const urlencoded = require("./urlencoded"); | ||
@@ -111,3 +110,12 @@ | ||
sort() { | ||
this._list = stableSortBy(this._list, [0]); | ||
this._list.sort((a, b) => { | ||
if (a[0] < b[0]) { | ||
return -1; | ||
} | ||
if (a[0] > b[0]) { | ||
return 1; | ||
} | ||
return 0; | ||
}); | ||
this._updateSteps(); | ||
@@ -114,0 +122,0 @@ } |
@@ -24,2 +24,3 @@ "use strict"; | ||
exports.percentDecode = percentEncoding.percentDecodeBytes; | ||
exports.percentDecodeString = percentEncoding.percentDecodeString; | ||
exports.percentDecodeBytes = percentEncoding.percentDecodeBytes; |
{ | ||
"name": "whatwg-url", | ||
"version": "8.7.0", | ||
"version": "9.0.0", | ||
"description": "An implementation of the WHATWG URL Standard's URL API and parsing machinery", | ||
@@ -15,3 +15,2 @@ "main": "index.js", | ||
"dependencies": { | ||
"lodash": "^4.7.0", | ||
"tr46": "^2.1.0", | ||
@@ -32,3 +31,3 @@ "webidl-conversions": "^6.1.0" | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=12" | ||
}, | ||
@@ -35,0 +34,0 @@ "scripts": { |
@@ -32,3 +32,4 @@ # whatwg-url | ||
- [Cannot have a username/password/port](https://url.spec.whatwg.org/#cannot-have-a-username-password-port): `cannotHaveAUsernamePasswordPort(urlRecord)` | ||
- [Percent decode](https://url.spec.whatwg.org/#percent-decode): `percentDecode(buffer)` | ||
- [Percent decode bytes](https://url.spec.whatwg.org/#percent-decode): `percentDecodeBytes(uint8Array)` | ||
- [Percent decode a string](https://url.spec.whatwg.org/#percent-decode-string): `percentDecodeString(string)` | ||
@@ -35,0 +36,0 @@ The `stateOverride` parameter is one of the following strings: |
2
106
90418
2469
- Removedlodash@^4.7.0
- Removedlodash@4.17.21(transitive)