Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update URI.fragmentURI.js #449

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/URI.fragmentURI.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
}(this, function (URI) {
'use strict';

var p = URI.prototype;
let p = URI.prototype;
// old handlers we need to wrap
var f = p.fragment;
var b = p.build;
let f = p.fragment;
let b = p.build;

// make fragmentPrefix configurable
URI.fragmentPrefix = '!';
var _parts = URI._parts;
let _parts = URI._parts;
URI._parts = function() {
var parts = _parts();
let parts = _parts();
parts.fragmentPrefix = URI.fragmentPrefix;
return parts;
};
Expand All @@ -53,9 +53,9 @@

// add fragment(true) and fragment(URI) signatures
p.fragment = function(v, build) {
var prefix = this._parts.fragmentPrefix;
var fragment = this._parts.fragment || '';
var furi;
let prefix = this._parts.fragmentPrefix;
let fragment = this._parts.fragment || '';
let furi;

if (v === true) {
if (fragment.substring(0, prefix.length) !== prefix) {
Expand All @@ -82,7 +82,7 @@

// make .build() of the actual URI aware of the FragmentURI
p.build = function(deferBuild) {
var t = b.call(this, deferBuild);
let t = b.call(this, deferBuild);

if (deferBuild !== false && this._parentURI) {
// update the parent
Expand All @@ -94,4 +94,4 @@

// extending existing object rather than defining something new
return URI;
}));
}));