Socket
Socket
Sign inDemoInstall

history

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

history - npm Package Compare versions

Comparing version 4.4.0 to 4.4.1

7

CHANGES.md

@@ -0,1 +1,8 @@

## [v4.4.1]
> Nov 24, 2016
- Fix the back button on Chrome iOS
[v4.4.1]: https://github.com/mjackson/history/compare/v4.4.0...v4.4.1
## [v4.4.0]

@@ -2,0 +9,0 @@ > Nov 1, 2016

3

createBrowserHistory.js

@@ -103,3 +103,4 @@ 'use strict';

var handlePopState = function handlePopState(event) {
if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.
// Ignore extraneous popstate events in WebKit.
if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return;

@@ -106,0 +107,0 @@ handlePop(getDOMLocation(event.state));

@@ -44,2 +44,11 @@ 'use strict';

return window.navigator.userAgent.indexOf('Firefox') === -1;
};
/**
* Returns true if a given popstate event is an extraneous WebKit event.
* Accounts for the fact that Chrome on iOS fires real popstate events
* containing undefined state when pressing the back button.
*/
var isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
};
{
"name": "history",
"version": "4.4.0",
"version": "4.4.1",
"description": "Manage session history with JavaScript",

@@ -5,0 +5,0 @@ "repository": "mjackson/history",

@@ -20,6 +20,6 @@ # history [![Travis][build-badge]][build] [![npm package][npm-badge]][npm]

```js
// using an ES6 transpiler, like babel
// using ES6 modules
import createHistory from 'history/createBrowserHistory'
// not using an ES6 transpiler
// using CommonJS modules
var createHistory = require('history').createBrowserHistory

@@ -26,0 +26,0 @@ ```

@@ -397,3 +397,4 @@ (function webpackUniversalModuleDefinition(root, factory) {

var handlePopState = function handlePopState(event) {
if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.
// Ignore extraneous popstate events in WebKit.
if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return;

@@ -868,2 +869,11 @@ handlePop(getDOMLocation(event.state));

/**
* Returns true if a given popstate event is an extraneous WebKit event.
* Accounts for the fact that Chrome on iOS fires real popstate events
* containing undefined state when pressing the back button.
*/
var isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
};
/***/ },

@@ -870,0 +880,0 @@ /* 11 */

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.History=n():t.History=n()}(this,function(){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0,n.createPath=n.parsePath=n.locationsAreEqual=n.createLocation=n.createMemoryHistory=n.createHashHistory=n.createBrowserHistory=void 0;var r=e(1);Object.defineProperty(n,"createLocation",{enumerable:!0,get:function(){return r.createLocation}}),Object.defineProperty(n,"locationsAreEqual",{enumerable:!0,get:function(){return r.locationsAreEqual}});var i=e(2);Object.defineProperty(n,"parsePath",{enumerable:!0,get:function(){return i.parsePath}}),Object.defineProperty(n,"createPath",{enumerable:!0,get:function(){return i.createPath}});var a=e(8),c=o(a),u=e(9),s=o(u),f=e(10),l=o(f);n.createBrowserHistory=c["default"],n.createHashHistory=s["default"],n.createMemoryHistory=l["default"]},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0,n.locationsAreEqual=n.createLocation=void 0;var r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},i=e(11),a=o(i),c=e(12),u=o(c),s=e(2);n.createLocation=function(t,n,e,o){var i=void 0;return"string"==typeof t?(i=(0,s.parsePath)(t),i.state=n):(i=r({},t),void 0===i.pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==n&&void 0===i.state&&(i.state=n)),i.key=e,o&&(i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=(0,a["default"])(i.pathname,o.pathname)):i.pathname=o.pathname),i},n.locationsAreEqual=function(t,n){return t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash&&t.key===n.key&&(0,u["default"])(t.state,n.state)}},function(t,n){"use strict";n.__esModule=!0;n.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},n.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t},n.stripPrefix=function(t,n){return 0===t.indexOf(n)?t.substr(n.length):t},n.parsePath=function(t){var n=t||"/",e="",o="",r=n.indexOf("#");r!==-1&&(o=n.substr(r),n=n.substr(0,r));var i=n.indexOf("?");return i!==-1&&(e=n.substr(i),n=n.substr(0,i)),{pathname:n,search:"?"===e?"":e,hash:"#"===o?"":o}},n.createPath=function(t){var n=t.pathname,e=t.search,o=t.hash,r=n||"/";return e&&"?"!==e&&(r+="?"===e.charAt(0)?e:"?"+e),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}},function(t,n,e){"use strict";var o=function(){};t.exports=o},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=e(3),i=(o(r),function(){var t=null,n=function(n){return t=n,function(){t===n&&(t=null)}},e=function(n,e,o,r){if(null!=t){var i="function"==typeof t?t(n,e):t;"string"==typeof i?"function"==typeof o?o(i,r):r(!0):r(i!==!1)}else r(!0)},o=[],r=function(t){return o.push(t),function(){o=o.filter(function(n){return n!==t})}},i=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return o.forEach(function(t){return t.apply(void 0,n)})};return{setPrompt:n,confirmTransitionTo:e,appendListener:r,notifyListeners:i}});n["default"]=i},function(t,n){"use strict";n.__esModule=!0;n.addEventListener=function(t,n,e){return t.addEventListener?t.addEventListener(n,e,!1):t.attachEvent("on"+n,e)},n.removeEventListener=function(t,n,e){return t.removeEventListener?t.removeEventListener(n,e,!1):t.detachEvent("on"+n,e)},n.getConfirmation=function(t,n){return n(window.confirm(t))},n.supportsHistory=function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},n.supportsPopStateOnHashChange=function(){return window.navigator.userAgent.indexOf("Trident")===-1},n.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1}},function(t,n){"use strict";n.__esModule=!0;n.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(t,n,e){"use strict";var o=function(t,n,e,o,r,i,a,c){if(!t){var u;if(void 0===n)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[e,o,r,i,a,c],f=0;u=new Error(n.replace(/%s/g,function(){return s[f++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};t.exports=o},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t}),i=e(3),a=(o(i),e(7)),c=o(a),u=e(1),s=e(2),f=e(4),l=o(f),d=e(6),h=e(5),v="popstate",p="hashchange",y=function(){try{return window.history.state||{}}catch(t){return{}}},g=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];d.canUseDOM?void 0:(0,c["default"])(!1);var n=window.history,e=(0,h.supportsHistory)(),o=!(0,h.supportsPopStateOnHashChange)(),i=t.basename,a=void 0===i?"":i,f=t.forceRefresh,g=void 0!==f&&f,m=t.getUserConfirmation,w=void 0===m?h.getConfirmation:m,P=t.keyLength,b=void 0===P?6:P,x=function(t){var n=t||{},e=n.key,o=n.state,i=window.location,c=i.pathname,u=i.search,f=i.hash,l=c+u+f;return a&&(l=(0,s.stripPrefix)(l,a)),r({},(0,s.parsePath)(l),{state:o,key:e})},O=function(){return Math.random().toString(36).substr(2,b)},L=(0,l["default"])(),_=function(t){r(W,t),W.length=n.length,L.notifyListeners(W.location,W.action)},E=function(t){void 0!==t.state&&k(x(t.state))},S=function(){k(x(y()))},A=!1,k=function(t){A?(A=!1,_()):!function(){var n="POP";L.confirmTransitionTo(t,n,w,function(e){e?_({action:n,location:t}):M(t)})}()},M=function(t){var n=W.location,e=j.indexOf(n.key);e===-1&&(e=0);var o=j.indexOf(t.key);o===-1&&(o=0);var r=e-o;r&&(A=!0,U(r))},T=x(y()),j=[T.key],H=function(t,o){var r="PUSH",i=(0,u.createLocation)(t,o,O(),W.location);L.confirmTransitionTo(i,r,w,function(t){if(t){var o=a+(0,s.createPath)(i),c=i.key,u=i.state;if(e)if(n.pushState({key:c,state:u},null,o),g)window.location.href=o;else{var f=j.indexOf(W.location.key),l=j.slice(0,f===-1?0:f+1);l.push(i.key),j=l,_({action:r,location:i})}else window.location.href=o}})},C=function(t,o){var r="REPLACE",i=(0,u.createLocation)(t,o,O(),W.location);L.confirmTransitionTo(i,r,w,function(t){if(t){var o=a+(0,s.createPath)(i),c=i.key,u=i.state;if(e)if(n.replaceState({key:c,state:u},null,o),g)window.location.replace(o);else{var f=j.indexOf(W.location.key);f!==-1&&(j[f]=i.key),_({action:r,location:i})}else window.location.replace(o)}})},U=function(t){n.go(t)},q=function(){return U(-1)},R=function(){return U(1)},B=0,I=function(t){B+=t,1===B?((0,h.addEventListener)(window,v,E),o&&(0,h.addEventListener)(window,p,S)):0===B&&((0,h.removeEventListener)(window,v,E),o&&(0,h.removeEventListener)(window,p,S))},F=!1,D=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],n=L.setPrompt(t);return F||(I(1),F=!0),function(){return F&&(F=!1,I(-1)),n()}},G=function(t){var n=L.appendListener(t);return I(1),function(){return I(-1),n()}},W={length:n.length,action:"POP",location:T,push:H,replace:C,go:U,goBack:q,goForward:R,block:D,listen:G};return W};n["default"]=g},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},i=e(3),a=(o(i),e(7)),c=o(a),u=e(1),s=e(2),f=e(4),l=o(f),d=e(6),h=e(5),v="hashchange",p={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+(0,s.stripLeadingSlash)(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:s.stripLeadingSlash,decodePath:s.addLeadingSlash},slash:{encodePath:s.addLeadingSlash,decodePath:s.addLeadingSlash}},y=function(){var t=window.location.href,n=t.indexOf("#");return n===-1?"":t.substring(n+1)},g=function(t){return window.location.hash=t},m=function(t){var n=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,n>=0?n:0)+"#"+t)},w=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];d.canUseDOM?void 0:(0,c["default"])(!1);var n=window.history,e=((0,h.supportsGoWithoutReloadUsingHash)(),t.basename),o=void 0===e?"":e,i=t.getUserConfirmation,a=void 0===i?h.getConfirmation:i,f=t.hashType,w=void 0===f?"slash":f,P=p[w],b=P.encodePath,x=P.decodePath,O=function(){var t=x(y());return o&&(t=(0,s.stripPrefix)(t,o)),(0,s.parsePath)(t)},L=(0,l["default"])(),_=function(t){r(z,t),z.length=n.length,L.notifyListeners(z.location,z.action)},E=!1,S=null,A=function(){var t=y(),n=b(t);if(t!==n)m(n);else{var e=O(),o=z.location;if(!E&&(0,u.locationsAreEqual)(o,e))return;if(S===(0,s.createPath)(e))return;S=null,k(e)}},k=function(t){E?(E=!1,_()):!function(){var n="POP";L.confirmTransitionTo(t,n,a,function(e){e?_({action:n,location:t}):M(t)})}()},M=function(t){var n=z.location,e=C.lastIndexOf((0,s.createPath)(n));e===-1&&(e=0);var o=C.lastIndexOf((0,s.createPath)(t));o===-1&&(o=0);var r=e-o;r&&(E=!0,R(r))},T=y(),j=b(T);T!==j&&m(j);var H=O(),C=[(0,s.createPath)(H)],U=function(t,n){var e="PUSH",r=(0,u.createLocation)(t,void 0,void 0,z.location);L.confirmTransitionTo(r,e,a,function(t){if(t){var n=(0,s.createPath)(r),i=b(o+n),a=y()!==i;if(a){S=n,g(i);var c=C.lastIndexOf((0,s.createPath)(z.location)),u=C.slice(0,c===-1?0:c+1);u.push(n),C=u,_({action:e,location:r})}else _()}})},q=function(t,n){var e="REPLACE",r=(0,u.createLocation)(t,void 0,void 0,z.location);L.confirmTransitionTo(r,e,a,function(t){if(t){var n=(0,s.createPath)(r),i=b(o+n),a=y()!==i;a&&(S=n,m(i));var c=C.indexOf((0,s.createPath)(z.location));c!==-1&&(C[c]=n),_({action:e,location:r})}})},R=function(t){n.go(t)},B=function(){return R(-1)},I=function(){return R(1)},F=0,D=function(t){F+=t,1===F?(0,h.addEventListener)(window,v,A):0===F&&(0,h.removeEventListener)(window,v,A)},G=!1,W=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],n=L.setPrompt(t);return G||(D(1),G=!0),function(){return G&&(G=!1,D(-1)),n()}},V=function(t){var n=L.appendListener(t);return D(1),function(){return D(-1),n()}},z={length:n.length,action:"POP",location:H,push:U,replace:q,go:R,goBack:B,goForward:I,block:W,listen:V};return z};n["default"]=w},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t}),i=e(3),a=(o(i),e(1)),c=e(4),u=o(c),s=function(t,n,e){return Math.min(Math.max(t,n),e)},f=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.getUserConfirmation,e=t.initialEntries,o=void 0===e?["/"]:e,i=t.initialIndex,c=void 0===i?0:i,f=t.keyLength,l=void 0===f?6:f,d=(0,u["default"])(),h=function(t){r(_,t),_.length=_.entries.length,d.notifyListeners(_.location,_.action)},v=function(){return Math.random().toString(36).substr(2,l)},p=s(c,0,o.length-1),y=o.map(function(t,n){return"string"==typeof t?(0,a.createLocation)(t,void 0,n?v():void 0):(0,a.createLocation)(t,void 0,n?t.key||v():void 0)}),g=function(t,e){var o="PUSH",r=(0,a.createLocation)(t,e,v(),_.location);d.confirmTransitionTo(r,o,n,function(t){if(t){var n=_.index,e=n+1,i=_.entries.slice(0);i.length>e?i.splice(e,i.length-e,r):i.push(r),h({action:o,location:r,index:e,entries:i})}})},m=function(t,e){var o="REPLACE",r=(0,a.createLocation)(t,e,v(),_.location);d.confirmTransitionTo(r,o,n,function(t){t&&(_.entries[_.index]=r,h({action:o,location:r}))})},w=function(t){var e=s(_.index+t,0,_.entries.length-1),o="POP",r=_.entries[e];d.confirmTransitionTo(r,o,n,function(t){t?h({action:o,location:r,index:e}):h()})},P=function(){return w(-1)},b=function(){return w(1)},x=function(t){var n=_.index+t;return n>=0&&n<_.entries.length},O=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0];return d.setPrompt(t)},L=function(t){return d.appendListener(t)},_={length:y.length,action:"POP",location:y[p],index:p,entries:y,push:g,replace:m,go:w,goBack:P,goForward:b,canGo:x,block:O,listen:L};return _};n["default"]=f},function(t,n,e){!function(n,e){t.exports=e()}(this,function(){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n){"use strict";var e=function(t){return"/"===t.charAt(0)},o=function(t,n){for(var e=n,o=e+1,r=t.length;r>o;e+=1,o+=1)t[e]=t[o];t.pop()},r=function(t){var n=arguments.length<=1||void 0===arguments[1]?"":arguments[1],r=t&&t.split("/")||[],i=n&&n.split("/")||[],a=t&&e(t),c=n&&e(n),u=a||c;if(t&&e(t)?i=r:r.length&&(i.pop(),i=i.concat(r)),!i.length)return"/";var s=void 0;if(i.length){var f=i[i.length-1];s="."===f||".."===f||""===f}else s=!1;for(var l=0,d=i.length;d>=0;d--){var h=i[d];"."===h?o(i,d):".."===h?(o(i,d),l++):l&&(o(i,d),l--)}if(!u)for(;l--;l)i.unshift("..");!u||""===i[0]||i[0]&&e(i[0])||i.unshift("");var v=i.join("/");return s&&"/"!==v.substr(-1)&&(v+="/"),v};t.exports=r}])})},function(t,n){"use strict";n.__esModule=!0;var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function r(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return!(!Array.isArray(n)||t.length!==n.length)&&t.every(function(t,e){return r(t,n[e])});var o="undefined"==typeof t?"undefined":e(t),i="undefined"==typeof n?"undefined":e(n);if(o!==i)return!1;if("object"===o){var a=t.valueOf(),c=n.valueOf();if(a!==t||c!==n)return r(a,c);var u=Object.keys(t),s=Object.keys(n);return u.length===s.length&&u.every(function(e){return r(t[e],n[e])})}return!1};n["default"]=o}])});
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.History=n():t.History=n()}(this,function(){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0,n.createPath=n.parsePath=n.locationsAreEqual=n.createLocation=n.createMemoryHistory=n.createHashHistory=n.createBrowserHistory=void 0;var r=e(1);Object.defineProperty(n,"createLocation",{enumerable:!0,get:function(){return r.createLocation}}),Object.defineProperty(n,"locationsAreEqual",{enumerable:!0,get:function(){return r.locationsAreEqual}});var i=e(2);Object.defineProperty(n,"parsePath",{enumerable:!0,get:function(){return i.parsePath}}),Object.defineProperty(n,"createPath",{enumerable:!0,get:function(){return i.createPath}});var a=e(8),c=o(a),u=e(9),s=o(u),f=e(10),l=o(f);n.createBrowserHistory=c["default"],n.createHashHistory=s["default"],n.createMemoryHistory=l["default"]},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0,n.locationsAreEqual=n.createLocation=void 0;var r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},i=e(11),a=o(i),c=e(12),u=o(c),s=e(2);n.createLocation=function(t,n,e,o){var i=void 0;return"string"==typeof t?(i=(0,s.parsePath)(t),i.state=n):(i=r({},t),void 0===i.pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==n&&void 0===i.state&&(i.state=n)),i.key=e,o&&(i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=(0,a["default"])(i.pathname,o.pathname)):i.pathname=o.pathname),i},n.locationsAreEqual=function(t,n){return t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash&&t.key===n.key&&(0,u["default"])(t.state,n.state)}},function(t,n){"use strict";n.__esModule=!0;n.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},n.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t},n.stripPrefix=function(t,n){return 0===t.indexOf(n)?t.substr(n.length):t},n.parsePath=function(t){var n=t||"/",e="",o="",r=n.indexOf("#");r!==-1&&(o=n.substr(r),n=n.substr(0,r));var i=n.indexOf("?");return i!==-1&&(e=n.substr(i),n=n.substr(0,i)),{pathname:n,search:"?"===e?"":e,hash:"#"===o?"":o}},n.createPath=function(t){var n=t.pathname,e=t.search,o=t.hash,r=n||"/";return e&&"?"!==e&&(r+="?"===e.charAt(0)?e:"?"+e),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}},function(t,n,e){"use strict";var o=function(){};t.exports=o},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=e(3),i=(o(r),function(){var t=null,n=function(n){return t=n,function(){t===n&&(t=null)}},e=function(n,e,o,r){if(null!=t){var i="function"==typeof t?t(n,e):t;"string"==typeof i?"function"==typeof o?o(i,r):r(!0):r(i!==!1)}else r(!0)},o=[],r=function(t){return o.push(t),function(){o=o.filter(function(n){return n!==t})}},i=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return o.forEach(function(t){return t.apply(void 0,n)})};return{setPrompt:n,confirmTransitionTo:e,appendListener:r,notifyListeners:i}});n["default"]=i},function(t,n){"use strict";n.__esModule=!0;n.addEventListener=function(t,n,e){return t.addEventListener?t.addEventListener(n,e,!1):t.attachEvent("on"+n,e)},n.removeEventListener=function(t,n,e){return t.removeEventListener?t.removeEventListener(n,e,!1):t.detachEvent("on"+n,e)},n.getConfirmation=function(t,n){return n(window.confirm(t))},n.supportsHistory=function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},n.supportsPopStateOnHashChange=function(){return window.navigator.userAgent.indexOf("Trident")===-1},n.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1},n.isExtraneousPopstateEvent=function(t){return void 0===t.state&&navigator.userAgent.indexOf("CriOS")===-1}},function(t,n){"use strict";n.__esModule=!0;n.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(t,n,e){"use strict";var o=function(t,n,e,o,r,i,a,c){if(!t){var u;if(void 0===n)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[e,o,r,i,a,c],f=0;u=new Error(n.replace(/%s/g,function(){return s[f++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};t.exports=o},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t}),i=e(3),a=(o(i),e(7)),c=o(a),u=e(1),s=e(2),f=e(4),l=o(f),d=e(6),h=e(5),v="popstate",p="hashchange",y=function(){try{return window.history.state||{}}catch(t){return{}}},g=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];d.canUseDOM?void 0:(0,c["default"])(!1);var n=window.history,e=(0,h.supportsHistory)(),o=!(0,h.supportsPopStateOnHashChange)(),i=t.basename,a=void 0===i?"":i,f=t.forceRefresh,g=void 0!==f&&f,m=t.getUserConfirmation,w=void 0===m?h.getConfirmation:m,P=t.keyLength,b=void 0===P?6:P,x=function(t){var n=t||{},e=n.key,o=n.state,i=window.location,c=i.pathname,u=i.search,f=i.hash,l=c+u+f;return a&&(l=(0,s.stripPrefix)(l,a)),r({},(0,s.parsePath)(l),{state:o,key:e})},O=function(){return Math.random().toString(36).substr(2,b)},L=(0,l["default"])(),E=function(t){r(W,t),W.length=n.length,L.notifyListeners(W.location,W.action)},S=function(t){(0,h.isExtraneousPopstateEvent)(t)||k(x(t.state))},_=function(){k(x(y()))},A=!1,k=function(t){A?(A=!1,E()):!function(){var n="POP";L.confirmTransitionTo(t,n,w,function(e){e?E({action:n,location:t}):M(t)})}()},M=function(t){var n=W.location,e=j.indexOf(n.key);e===-1&&(e=0);var o=j.indexOf(t.key);o===-1&&(o=0);var r=e-o;r&&(A=!0,U(r))},T=x(y()),j=[T.key],H=function(t,o){var r="PUSH",i=(0,u.createLocation)(t,o,O(),W.location);L.confirmTransitionTo(i,r,w,function(t){if(t){var o=a+(0,s.createPath)(i),c=i.key,u=i.state;if(e)if(n.pushState({key:c,state:u},null,o),g)window.location.href=o;else{var f=j.indexOf(W.location.key),l=j.slice(0,f===-1?0:f+1);l.push(i.key),j=l,E({action:r,location:i})}else window.location.href=o}})},C=function(t,o){var r="REPLACE",i=(0,u.createLocation)(t,o,O(),W.location);L.confirmTransitionTo(i,r,w,function(t){if(t){var o=a+(0,s.createPath)(i),c=i.key,u=i.state;if(e)if(n.replaceState({key:c,state:u},null,o),g)window.location.replace(o);else{var f=j.indexOf(W.location.key);f!==-1&&(j[f]=i.key),E({action:r,location:i})}else window.location.replace(o)}})},U=function(t){n.go(t)},q=function(){return U(-1)},R=function(){return U(1)},B=0,I=function(t){B+=t,1===B?((0,h.addEventListener)(window,v,S),o&&(0,h.addEventListener)(window,p,_)):0===B&&((0,h.removeEventListener)(window,v,S),o&&(0,h.removeEventListener)(window,p,_))},F=!1,D=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],n=L.setPrompt(t);return F||(I(1),F=!0),function(){return F&&(F=!1,I(-1)),n()}},G=function(t){var n=L.appendListener(t);return I(1),function(){return I(-1),n()}},W={length:n.length,action:"POP",location:T,push:H,replace:C,go:U,goBack:q,goForward:R,block:D,listen:G};return W};n["default"]=g},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},i=e(3),a=(o(i),e(7)),c=o(a),u=e(1),s=e(2),f=e(4),l=o(f),d=e(6),h=e(5),v="hashchange",p={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+(0,s.stripLeadingSlash)(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:s.stripLeadingSlash,decodePath:s.addLeadingSlash},slash:{encodePath:s.addLeadingSlash,decodePath:s.addLeadingSlash}},y=function(){var t=window.location.href,n=t.indexOf("#");return n===-1?"":t.substring(n+1)},g=function(t){return window.location.hash=t},m=function(t){var n=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,n>=0?n:0)+"#"+t)},w=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];d.canUseDOM?void 0:(0,c["default"])(!1);var n=window.history,e=((0,h.supportsGoWithoutReloadUsingHash)(),t.basename),o=void 0===e?"":e,i=t.getUserConfirmation,a=void 0===i?h.getConfirmation:i,f=t.hashType,w=void 0===f?"slash":f,P=p[w],b=P.encodePath,x=P.decodePath,O=function(){var t=x(y());return o&&(t=(0,s.stripPrefix)(t,o)),(0,s.parsePath)(t)},L=(0,l["default"])(),E=function(t){r(z,t),z.length=n.length,L.notifyListeners(z.location,z.action)},S=!1,_=null,A=function(){var t=y(),n=b(t);if(t!==n)m(n);else{var e=O(),o=z.location;if(!S&&(0,u.locationsAreEqual)(o,e))return;if(_===(0,s.createPath)(e))return;_=null,k(e)}},k=function(t){S?(S=!1,E()):!function(){var n="POP";L.confirmTransitionTo(t,n,a,function(e){e?E({action:n,location:t}):M(t)})}()},M=function(t){var n=z.location,e=C.lastIndexOf((0,s.createPath)(n));e===-1&&(e=0);var o=C.lastIndexOf((0,s.createPath)(t));o===-1&&(o=0);var r=e-o;r&&(S=!0,R(r))},T=y(),j=b(T);T!==j&&m(j);var H=O(),C=[(0,s.createPath)(H)],U=function(t,n){var e="PUSH",r=(0,u.createLocation)(t,void 0,void 0,z.location);L.confirmTransitionTo(r,e,a,function(t){if(t){var n=(0,s.createPath)(r),i=b(o+n),a=y()!==i;if(a){_=n,g(i);var c=C.lastIndexOf((0,s.createPath)(z.location)),u=C.slice(0,c===-1?0:c+1);u.push(n),C=u,E({action:e,location:r})}else E()}})},q=function(t,n){var e="REPLACE",r=(0,u.createLocation)(t,void 0,void 0,z.location);L.confirmTransitionTo(r,e,a,function(t){if(t){var n=(0,s.createPath)(r),i=b(o+n),a=y()!==i;a&&(_=n,m(i));var c=C.indexOf((0,s.createPath)(z.location));c!==-1&&(C[c]=n),E({action:e,location:r})}})},R=function(t){n.go(t)},B=function(){return R(-1)},I=function(){return R(1)},F=0,D=function(t){F+=t,1===F?(0,h.addEventListener)(window,v,A):0===F&&(0,h.removeEventListener)(window,v,A)},G=!1,W=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],n=L.setPrompt(t);return G||(D(1),G=!0),function(){return G&&(G=!1,D(-1)),n()}},V=function(t){var n=L.appendListener(t);return D(1),function(){return D(-1),n()}},z={length:n.length,action:"POP",location:H,push:U,replace:q,go:R,goBack:B,goForward:I,block:W,listen:V};return z};n["default"]=w},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t}),i=e(3),a=(o(i),e(1)),c=e(4),u=o(c),s=function(t,n,e){return Math.min(Math.max(t,n),e)},f=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.getUserConfirmation,e=t.initialEntries,o=void 0===e?["/"]:e,i=t.initialIndex,c=void 0===i?0:i,f=t.keyLength,l=void 0===f?6:f,d=(0,u["default"])(),h=function(t){r(E,t),E.length=E.entries.length,d.notifyListeners(E.location,E.action)},v=function(){return Math.random().toString(36).substr(2,l)},p=s(c,0,o.length-1),y=o.map(function(t,n){return"string"==typeof t?(0,a.createLocation)(t,void 0,n?v():void 0):(0,a.createLocation)(t,void 0,n?t.key||v():void 0)}),g=function(t,e){var o="PUSH",r=(0,a.createLocation)(t,e,v(),E.location);d.confirmTransitionTo(r,o,n,function(t){if(t){var n=E.index,e=n+1,i=E.entries.slice(0);i.length>e?i.splice(e,i.length-e,r):i.push(r),h({action:o,location:r,index:e,entries:i})}})},m=function(t,e){var o="REPLACE",r=(0,a.createLocation)(t,e,v(),E.location);d.confirmTransitionTo(r,o,n,function(t){t&&(E.entries[E.index]=r,h({action:o,location:r}))})},w=function(t){var e=s(E.index+t,0,E.entries.length-1),o="POP",r=E.entries[e];d.confirmTransitionTo(r,o,n,function(t){t?h({action:o,location:r,index:e}):h()})},P=function(){return w(-1)},b=function(){return w(1)},x=function(t){var n=E.index+t;return n>=0&&n<E.entries.length},O=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0];return d.setPrompt(t)},L=function(t){return d.appendListener(t)},E={length:y.length,action:"POP",location:y[p],index:p,entries:y,push:g,replace:m,go:w,goBack:P,goForward:b,canGo:x,block:O,listen:L};return E};n["default"]=f},function(t,n,e){!function(n,e){t.exports=e()}(this,function(){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n){"use strict";var e=function(t){return"/"===t.charAt(0)},o=function(t,n){for(var e=n,o=e+1,r=t.length;r>o;e+=1,o+=1)t[e]=t[o];t.pop()},r=function(t){var n=arguments.length<=1||void 0===arguments[1]?"":arguments[1],r=t&&t.split("/")||[],i=n&&n.split("/")||[],a=t&&e(t),c=n&&e(n),u=a||c;if(t&&e(t)?i=r:r.length&&(i.pop(),i=i.concat(r)),!i.length)return"/";var s=void 0;if(i.length){var f=i[i.length-1];s="."===f||".."===f||""===f}else s=!1;for(var l=0,d=i.length;d>=0;d--){var h=i[d];"."===h?o(i,d):".."===h?(o(i,d),l++):l&&(o(i,d),l--)}if(!u)for(;l--;l)i.unshift("..");!u||""===i[0]||i[0]&&e(i[0])||i.unshift("");var v=i.join("/");return s&&"/"!==v.substr(-1)&&(v+="/"),v};t.exports=r}])})},function(t,n){"use strict";n.__esModule=!0;var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function r(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return!(!Array.isArray(n)||t.length!==n.length)&&t.every(function(t,e){return r(t,n[e])});var o="undefined"==typeof t?"undefined":e(t),i="undefined"==typeof n?"undefined":e(n);if(o!==i)return!1;if("object"===o){var a=t.valueOf(),c=n.valueOf();if(a!==t||c!==n)return r(a,c);var u=Object.keys(t),s=Object.keys(n);return u.length===s.length&&u.every(function(e){return r(t[e],n[e])})}return!1};n["default"]=o}])});
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