Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@tanstack/history

Package Overview
Dependencies
Maintainers
2
Versions
181
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/history - npm Package Compare versions

Comparing version 0.0.1-beta.226 to 0.0.1-beta.227

1

build/cjs/index.js

@@ -139,3 +139,2 @@ /**

function createBrowserHistory(opts) {
console.log('hello');
const getHref = opts?.getHref ?? (() => `${window.location.pathname}${window.location.search}${window.location.hash}`);

@@ -142,0 +141,0 @@ const createHref = opts?.createHref ?? (path => path);

@@ -137,3 +137,2 @@ /**

function createBrowserHistory(opts) {
console.log('hello');
const getHref = opts?.getHref ?? (() => `${window.location.pathname}${window.location.search}${window.location.hash}`);

@@ -140,0 +139,0 @@ const createHref = opts?.createHref ?? (path => path);

14

build/stats-react.json

@@ -11,3 +11,3 @@ {

"name": "packages/history/src/index.ts",
"uid": "bd4a-3"
"uid": "f062-3"
}

@@ -20,14 +20,14 @@ ]

"nodeParts": {
"bd4a-3": {
"renderedLength": 8926,
"gzipLength": 2619,
"f062-3": {
"renderedLength": 8900,
"gzipLength": 2605,
"brotliLength": 0,
"metaUid": "bd4a-2"
"metaUid": "f062-2"
}
},
"nodeMetas": {
"bd4a-2": {
"f062-2": {
"id": "/packages/history/src/index.ts",
"moduleParts": {
"index.production.js": "bd4a-3"
"index.production.js": "f062-3"
},

@@ -34,0 +34,0 @@ "imported": [],

@@ -143,3 +143,2 @@ /**

function createBrowserHistory(opts) {
console.log('hello');
const getHref = opts?.getHref ?? (() => `${window.location.pathname}${window.location.search}${window.location.hash}`);

@@ -146,0 +145,0 @@ const createHref = opts?.createHref ?? (path => path);

@@ -11,3 +11,3 @@ /**

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TanStackHistory={})}(this,(function(t){"use strict";const e="pushstate",o="popstate",n="beforeunload",r=t=>(t.preventDefault(),t.returnValue=""),i=()=>{removeEventListener(n,r,{capture:!0})};function s(t){let e=t.getLocation(),o=new Set,s=[],h=[];const c=()=>{e=t.getLocation(),o.forEach((t=>t()))},d=()=>{if(s.length)s[0]?.(d,(()=>{s=[],i()}));else for(;h.length;)h.shift()?.()},u=t=>{h.push(t),d()};return{get location(){return e},subscribe:t=>(o.add(t),()=>{o.delete(t)}),push:(e,o)=>{o=a(o),u((()=>{t.pushState(e,o,c)}))},replace:(e,o)=>{o=a(o),u((()=>{t.replaceState(e,o,c)}))},go:e=>{u((()=>{t.go(e)}))},back:()=>{u((()=>{t.back()}))},forward:()=>{u((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(s.push(t),1===s.length&&addEventListener(n,r,{capture:!0}),()=>{s=s.filter((e=>e!==t)),s.length||i()}),flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:c}}function a(t){return t||(t={}),{...t,key:d()}}function h(t){console.log("hello");const n=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=t?.createHref??(t=>t);let i=c(n(),window.history.state);let a,h,d=!0;const u=()=>{d=!1,(()=>{a&&(window.history[a.isPush?"pushState":"replaceState"](a.state,"",a.href),a=void 0,h=void 0)})(),d=!0},l=(t,e,o,n)=>{const s=r(e);i=c(s,o),a={href:s,state:o,isPush:a?.isPush||"push"===t},n(),h||(h=Promise.resolve().then((()=>u())))},f=()=>{i=c(n(),window.history.state),y.notify()};var w=window.history.pushState,p=window.history.replaceState;const y=s({getLocation:()=>i,pushState:(t,e,o)=>l("push",t,e,o),replaceState:(t,e,o)=>l("replace",t,e,o),back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t),flush:u,destroy:()=>{window.history.pushState=w,window.history.replaceState=p,window.removeEventListener(e,f),window.removeEventListener(o,f)}});return window.addEventListener(e,f),window.addEventListener(o,f),window.history.pushState=function(){let t=w.apply(window.history,arguments);return d&&y.notify(),t},window.history.replaceState=function(){let t=p.apply(window.history,arguments);return d&&y.notify(),t},y}function c(t,e){let o=t.indexOf("#"),n=t.indexOf("?");return{href:t,pathname:t.substring(0,o>0?n>0?Math.min(o,n):o:n>0?n:t.length),hash:o>-1?t.substring(o):"",search:n>-1?t.slice(n,-1===o?void 0:o):"",state:e||{}}}function d(){return(Math.random()+1).toString(36).substring(7)}t.createBrowserHistory=h,t.createHashHistory=function(){return h({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=function(t={initialEntries:["/"]}){const e=t.initialEntries;let o=t.initialIndex??e.length-1,n={key:d()};return s({getLocation:()=>c(e[o],n),pushState:(t,r)=>{n=r,e.push(t),o++},replaceState:(t,r)=>{n=r,e[o]=t},back:()=>{o--},forward:()=>{o=Math.min(o+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TanStackHistory={})}(this,(function(t){"use strict";const e="pushstate",n="popstate",o="beforeunload",r=t=>(t.preventDefault(),t.returnValue=""),i=()=>{removeEventListener(o,r,{capture:!0})};function s(t){let e=t.getLocation(),n=new Set,s=[],h=[];const c=()=>{e=t.getLocation(),n.forEach((t=>t()))},d=()=>{if(s.length)s[0]?.(d,(()=>{s=[],i()}));else for(;h.length;)h.shift()?.()},u=t=>{h.push(t),d()};return{get location(){return e},subscribe:t=>(n.add(t),()=>{n.delete(t)}),push:(e,n)=>{n=a(n),u((()=>{t.pushState(e,n,c)}))},replace:(e,n)=>{n=a(n),u((()=>{t.replaceState(e,n,c)}))},go:e=>{u((()=>{t.go(e)}))},back:()=>{u((()=>{t.back()}))},forward:()=>{u((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(s.push(t),1===s.length&&addEventListener(o,r,{capture:!0}),()=>{s=s.filter((e=>e!==t)),s.length||i()}),flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:c}}function a(t){return t||(t={}),{...t,key:d()}}function h(t){const o=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=t?.createHref??(t=>t);let i=c(o(),window.history.state);let a,h,d=!0;const u=()=>{d=!1,(()=>{a&&(window.history[a.isPush?"pushState":"replaceState"](a.state,"",a.href),a=void 0,h=void 0)})(),d=!0},f=(t,e,n,o)=>{const s=r(e);i=c(s,n),a={href:s,state:n,isPush:a?.isPush||"push"===t},o(),h||(h=Promise.resolve().then((()=>u())))},w=()=>{i=c(o(),window.history.state),y.notify()};var l=window.history.pushState,p=window.history.replaceState;const y=s({getLocation:()=>i,pushState:(t,e,n)=>f("push",t,e,n),replaceState:(t,e,n)=>f("replace",t,e,n),back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t),flush:u,destroy:()=>{window.history.pushState=l,window.history.replaceState=p,window.removeEventListener(e,w),window.removeEventListener(n,w)}});return window.addEventListener(e,w),window.addEventListener(n,w),window.history.pushState=function(){let t=l.apply(window.history,arguments);return d&&y.notify(),t},window.history.replaceState=function(){let t=p.apply(window.history,arguments);return d&&y.notify(),t},y}function c(t,e){let n=t.indexOf("#"),o=t.indexOf("?");return{href:t,pathname:t.substring(0,n>0?o>0?Math.min(n,o):n:o>0?o:t.length),hash:n>-1?t.substring(n):"",search:o>-1?t.slice(o,-1===n?void 0:n):"",state:e||{}}}function d(){return(Math.random()+1).toString(36).substring(7)}t.createBrowserHistory=h,t.createHashHistory=function(){return h({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=function(t={initialEntries:["/"]}){const e=t.initialEntries;let n=t.initialIndex??e.length-1,o={key:d()};return s({getLocation:()=>c(e[n],o),pushState:(t,r)=>{o=r,e.push(t),n++},replaceState:(t,r)=>{o=r,e[n]=t},back:()=>{n--},forward:()=>{n=Math.min(n+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}}));
//# sourceMappingURL=index.production.js.map
{
"name": "@tanstack/history",
"author": "Tanner Linsley",
"version": "0.0.1-beta.226",
"version": "0.0.1-beta.227",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": "tanstack/history",

@@ -185,3 +185,2 @@ // While the public API was clearly inspired by the "history" npm package,

}): RouterHistory {
console.log('hello')
const getHref =

@@ -188,0 +187,0 @@ opts?.getHref ??

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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