whatwg-url-compat
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -1042,2 +1042,3 @@ "use strict"; | ||
const isURLSymbol = Symbol("isURL"); | ||
const updateStepsSymbol = Symbol("updateSteps"); | ||
@@ -1090,3 +1091,3 @@ function setTheInput(obj, input, url) { | ||
setTheInput(this, input); | ||
// TODO: Run pre-update steps | ||
preUpdateSteps(this, input); | ||
} | ||
@@ -1141,2 +1142,3 @@ }, | ||
this[urlSymbol] = new URLStateMachine(val + ":", null, null, this[urlSymbol].url, STATES.SCHEME_START); | ||
preUpdateSteps(this); | ||
}, | ||
@@ -1157,2 +1159,3 @@ | ||
} | ||
preUpdateSteps(this); | ||
}, | ||
@@ -1173,2 +1176,3 @@ | ||
} | ||
preUpdateSteps(this); | ||
}, | ||
@@ -1188,2 +1192,3 @@ | ||
this[urlSymbol] = new URLStateMachine(val, null, null, this[urlSymbol].url, STATES.HOST); | ||
preUpdateSteps(this); | ||
}, | ||
@@ -1202,2 +1207,3 @@ | ||
this[urlSymbol] = new URLStateMachine(val, null, null, this[urlSymbol].url, STATES.HOST_NAME); | ||
preUpdateSteps(this); | ||
}, | ||
@@ -1216,2 +1222,3 @@ | ||
this[urlSymbol] = new URLStateMachine(val, null, null, this[urlSymbol].url, STATES.PORT); | ||
preUpdateSteps(this); | ||
}, | ||
@@ -1235,2 +1242,3 @@ | ||
this[urlSymbol] = new URLStateMachine(val, null, null, this[urlSymbol].url, STATES.PATH_START); | ||
preUpdateSteps(this); | ||
}, | ||
@@ -1252,2 +1260,3 @@ | ||
// TODO: empty query object | ||
preUpdateSteps(this); | ||
return; | ||
@@ -1263,2 +1272,4 @@ } | ||
// TODO: Update query object | ||
// Since the query object isn't implemented, call updateSteps manually for now | ||
preUpdateSteps(this); | ||
}, | ||
@@ -1279,2 +1290,3 @@ | ||
this[urlSymbol].url.fragment = null; | ||
preUpdateSteps(this); | ||
return; | ||
@@ -1286,2 +1298,3 @@ } | ||
this[urlSymbol] = new URLStateMachine(input, null, null, this[urlSymbol].url, STATES.FRAGMENT); | ||
preUpdateSteps(this); | ||
} | ||
@@ -1328,2 +1341,10 @@ }; | ||
function preUpdateSteps(obj, value) { | ||
if (value === undefined) { | ||
value = serializeURL(obj[urlSymbol].url); | ||
} | ||
obj[updateStepsSymbol].call(obj, value); | ||
} | ||
module.exports.createURLConstructor = function () { | ||
@@ -1342,3 +1363,3 @@ function URL() { | ||
module.exports.mixinURLUtils = function (obj, base) { | ||
module.exports.mixinURLUtils = function (obj, base, updateSteps) { | ||
obj[isURLSymbol] = false; | ||
@@ -1350,2 +1371,4 @@ if (typeof base === "function") { | ||
} | ||
obj[updateStepsSymbol] = updateSteps || function () {}; | ||
setTheInput(obj, null, null); | ||
@@ -1356,3 +1379,3 @@ | ||
module.exports.setTheInput = function(obj, input) { | ||
module.exports.setTheInput = function (obj, input) { | ||
setTheInput(obj, input, null); | ||
@@ -1359,0 +1382,0 @@ }; |
{ | ||
"name": "whatwg-url-compat", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "An implementation of the WHATWG URL algorithm", | ||
@@ -5,0 +5,0 @@ "main": "lib/url.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38427
1197