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

@swan-io/chicane

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swan-io/chicane - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

2

dist/index.d.ts

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

export { Link } from "./Link";
export { createGroup } from "./createGroup";
export { createRouter } from "./createRouter";
export { getLocation, pushUnsafe, replaceUnsafe, subscribeToLocation, useLocation, } from "./history";
export { Link } from "./Link";
export { decodeSearch, encodeSearch } from "./search";

@@ -6,0 +6,0 @@ export { ServerUrlProvider } from "./server";

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

var e=require("history"),r=require("react"),t=require("use-sync-external-store/shim/with-selector.js"),n=require("use-sync-external-store/shim/index.js"),a=require("@emotion/hash");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,r}var u=/*#__PURE__*/i(r),c=/*#__PURE__*/o(a),s=function(e,r){return""===e?e:r+e},l=function(e){return"/"===e[0]?e:"/"+e},h=function(r){var t=e.parsePath(r),n=t.pathname,a=t.search,o=t.hash,i=void 0===o?"":o;return{path:void 0===n?"":n,search:(void 0===a?"":a).substring(1),hash:i.substring(1)}},f=function(e,r){var t=l(e.path),n=l(r.path),a="/"===t?n:"/"===n?t:t+n,o=""===e.search?r.search:e.search+s(r.search,"&"),i=""===r.hash?e.hash:r.hash;return a+s(o,"?")+s(i,"#")};function p(){return p=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},p.apply(this,arguments)}function v(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function d(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return v(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?v(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var y=function(e){return e[0]},m=function(e){return e},g=function(e){return""!==e},b=function(e){return e.startsWith(":")},w=function(e,r){return e.length===r.length&&e.every(function(e,t){return e===r[t]})},S=function(e,r){return(null==e?void 0:e.key)===(null==r?void 0:r.key)},k=function(e){for(var r,t={},n=d(new URLSearchParams(e));!(r=n()).done;){var a=r.value,o=a[0],i=a[1],u=t[o];t[o]=null!=u?"string"==typeof u?[u,i]:u.concat(i):i}return t},O=function(e,r,t){var n=e+(""!==e?"&":"")+encodeURIComponent(r);return""!==t?n+"="+encodeURIComponent(t):n},x=function(e){var r=Object.keys(e);if(0===r.length)return"";var t="";r.sort();for(var n=0,a=r;n<a.length;n++){var o=a[n],i=e[o];if(null!=i)if("string"==typeof i)t=O(t,o,i);else for(var u,c=d(i);!(u=c()).done;)t=O(t,o,u.value)}return""===t?"":"?"+t},P=function(e,r){var t=e.search,n=e.hash,a=e.pathname.substring(1),o=""!==a?r?a.split("/").filter(g).map(decodeURIComponent):a.split("/").map(decodeURIComponent):[],i=""!==t?k(t):{},u=""!==n?decodeURIComponent(n.substring(1)):null,s="/"+o.map(encodeURIComponent).join("/"),l=x(i),h=null!=u?"#"+encodeURIComponent(u):"",f=s+l+h;return p({key:c.default(s)+"-"+c.default(l+h),path:o,search:i},null!==u&&{hash:u},{raw:{path:s,search:l,hash:h},toString:function(){return f}})},j=new Set,C="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.createBrowserHistory():e.createMemoryHistory(),R=P(C.location,!0),U=!1;R.toString()!==e.createPath(C.location)&&C.replace(R.toString()),C.listen(function(e){var r=P(e.location,!1);if(r.toString()!==R.toString()){U=!0;var t=r.raw.search!==R.raw.search,n=t?{}:R.search;if(t)for(var a in r.search)if(Object.prototype.hasOwnProperty.call(r.search,a)){var o=r.search[a];if(null==o)continue;var i=R.search[a];n[a]=null!=i&&"string"!=typeof i&&"string"!=typeof o&&w(o,i)?i:o}R=p({key:r.key,path:r.raw.path!==R.raw.path?r.path:R.path,search:n},null!=r.hash&&{hash:r.hash},{raw:r.raw,toString:r.toString}),j.forEach(function(e){return e(R)})}});var I=function(e){return j.add(e),function(){j.delete(e)}},E=function(){return R},A=u.createContext(E),N=A.Provider,L=function(){return u.useContext(A)},q=function(r){var t=e.parsePath(r),n=t.pathname,a=t.search,o=t.hash;C.push({pathname:void 0===n?"":n,search:void 0===a?"":a,hash:void 0===o?"":o})},T=function(r){var t=e.parsePath(r),n=t.pathname,a=t.search,o=t.hash;C.replace({pathname:void 0===n?"":n,search:void 0===a?"":a,hash:void 0===o?"":o})},M=function(r,t){var n,a=e.parsePath(t),o=a.pathname,i=void 0===o?"/":o,u=a.search,c=a.hash,s=i.endsWith("/*"),l=function(e){for(var r,t=e.split("/").filter(g),n=[],a=t.length>0?4*t.length:5,o=d(t);!(r=o()).done;){var i=r.value,u=b(i);a+=u?2:3,n.push(u?{name:i.substring(1)}:encodeURIComponent(i))}return{ranking:a,path:n}}(s?i.slice(0,-2):i),h=l.ranking,f={isArea:s,name:r,ranking:s?h-1:h,path:l.path,search:void 0,hash:void 0};if(null!=u){f.search={};for(var p,v=d(new URLSearchParams(u.substring(1)));!(p=v()).done;){var y=p.value[0];(n=y).startsWith(":")&&n.endsWith("[]")?f.search[y.substring(1,y.length-2)]="multiple":b(y)&&(f.search[y.substring(1,y.length)]="unique")}}return null!=c&&b(c.substring(1))&&(f.hash=c.substring(2)),f},W=function(e,r){var t=e.path,n=r.isArea,a=r.path;if(!(!n&&t.length!==a.length||n&&t.length<a.length)){for(var o={},i=0;i<a.length;i++){var u=t[i],c=a[i];if(null!=c)if("string"==typeof c){if(c!==u)return}else{if(null==u)return;o[c.name]=u}}for(var s in r.search)if(Object.prototype.hasOwnProperty.call(r.search,s)){var l=r.search[s],h=e.search[s];if(null==l||null==h)continue;if("multiple"===l){o[s]="string"==typeof h?[h]:h;continue}"string"==typeof h?o[s]=h:null!=h[0]&&(o[s]=h[0])}return null!=r.hash&&null!=e.hash&&(o[r.hash]=e.hash),o}},K=function(e,r){for(var t,n=d(r);!(t=n()).done;){var a=t.value,o=W(e,a);if(null!=o)return{key:e.key,name:a.name,params:o}}},_=function(e,r){void 0===r&&(r={});var t="/"+e.path.map(function(e){return encodeURIComponent("string"==typeof e?e:String(r[e.name]))}).join("/"),n="",a="";if(null!=e.search){var o={};for(var i in r){var u=r[i];Object.prototype.hasOwnProperty.call(r,i)&&Object.prototype.hasOwnProperty.call(e.search,i)&&null!=u&&(o[i]=u)}n=x(o)}if(null!=e.hash){var c=r[e.hash];"string"==typeof c&&(a="#"+encodeURIComponent(c))}return{pathname:t,search:n,hash:a}},B=function(r){var t=r.href,a=r.replace,o=void 0!==a&&a,i=r.target,c=u.useMemo(function(){return e.parsePath(t).pathname},[t]),s=L(),l=function(){return c===s().raw.path},h=n.useSyncExternalStore(I,l,l),f=o||h,p=null==i||"_self"===i;return{active:h,onClick:u.useCallback(function(e){e.defaultPrevented||!p||0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),f?T(t):q(t))},[f,p,t])}},D=["onClick","className","replace","style","target","to","activeClassName","activeStyle"],H=u.forwardRef(function(e,r){var t=e.onClick,n=e.className,a=e.replace,o=e.style,i=e.target,c=e.to,s=e.activeClassName,l=e.activeStyle,h=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r.indexOf(t=o[n])>=0||(a[t]=e[t]);return a}(e,D),f=B({href:c,replace:a,target:i}),v=f.active,d=f.onClick;return u.createElement("a",p({},h,{ref:r,href:c,onClick:function(e){null==t||t(e),d(e)},target:i,className:v&&null!=s?null==n?s:n+" "+s:n,style:v&&null!=l?null==o?l:p({},o,l):o}))});H.displayName="Link";var F={A:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0};exports.Link=H,exports.ServerUrlProvider=function(r){var t=r.children,n=e.parsePath(r.value),a=n.pathname,o=n.search,i=n.hash,c=P({pathname:void 0===a?"/":a,search:void 0===o?"":o,hash:void 0===i?"":i},!1);return u.createElement(N,{children:t,value:function(){return c}})},exports.createGroup=function(e,r,t){var n=h(r),a={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(a[e+o]=f(n,h(t[o])));return a},exports.createRouter=function(r,n){void 0===n&&(n={});var a=n.basePath,o=void 0===a?"":a,i={path:h(o).path,search:"",hash:""},c={},s=[];for(var l in r)if(Object.prototype.hasOwnProperty.call(r,l)){var v=M(l,""!==o?f(i,h(r[l])):r[l]);c[l]=v,s.push(v)}s.sort(function(e,r){return r.ranking-e.ranking});for(var d={},g=function(){var r=s[b];if(null!=r&&!r.isArea){var t=r.name;d[t]=function(r){return e.createPath(_(c[t],r))}}},b=0;b<s.length;b++)g();return p({useRoute:function(e){var r=JSON.stringify(e),n=u.useMemo(function(){return s.filter(function(r){return e.includes(r.name)})},[r]),a=L(),o=function(){return K(a(),n)};return t.useSyncExternalStoreWithSelector(I,o,o,m,S)},getRoute:function(e){var r=E(),t=s.filter(function(r){return e.includes(r.name)});return K(r,t)},push:function(e){return C.push(_(c[e],y([].slice.call(arguments,1))))},replace:function(e){return C.replace(_(c[e],y([].slice.call(arguments,1))))}},d)},exports.decodeSearch=k,exports.encodeSearch=x,exports.getLocation=E,exports.pushUnsafe=q,exports.replaceUnsafe=T,exports.subscribeToLocation=I,exports.useFocusReset=function(e){var r=e.route,t=e.containerRef,n=null==r?void 0:r.key.split("-")[0];u.useEffect(function(){var e=t.current;if(e&&U)try{null!=e.getAttribute("tabIndex")||F[e.nodeName]||e.setAttribute("tabIndex","-1"),e.focus()}catch(e){}},[t,n])},exports.useLinkProps=B,exports.useLocation=function(){var e=L();return n.useSyncExternalStore(I,e,e)},exports.useNavigationBlocker=function(e,r){u.useEffect(function(){if(e){var t=C.block(function(e){window.confirm(r)&&(t(),e.retry())});return t}},[e])};
var e=require("react"),r=require("history"),t=require("use-sync-external-store/shim/index.js"),n=require("@emotion/hash"),a=require("use-sync-external-store/shim/with-selector.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,r}var u=/*#__PURE__*/i(e),c=/*#__PURE__*/o(n);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},s.apply(this,arguments)}function l(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function h(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return l(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f=function(e){return e[0]},p=function(e){return e},v=function(e){return""!==e},d=function(e){return e.startsWith(":")},y=function(e,r){return e.length===r.length&&e.every(function(e,t){return e===r[t]})},m=function(e,r){return(null==e?void 0:e.key)===(null==r?void 0:r.key)},g=function(e){for(var r,t={},n=h(new URLSearchParams(e));!(r=n()).done;){var a=r.value,o=a[0],i=a[1],u=t[o];t[o]=null!=u?"string"==typeof u?[u,i]:u.concat(i):i}return t},b=function(e,r,t){var n=e+(""!==e?"&":"")+encodeURIComponent(r);return""!==t?n+"="+encodeURIComponent(t):n},w=function(e){var r=Object.keys(e);if(0===r.length)return"";var t="";r.sort();for(var n=0,a=r;n<a.length;n++){var o=a[n],i=e[o];if(null!=i)if("string"==typeof i)t=b(t,o,i);else for(var u,c=h(i);!(u=c()).done;)t=b(t,o,u.value)}return""===t?"":"?"+t},S=function(e,r){var t=e.search,n=e.hash,a=e.pathname.substring(1),o=""!==a?r?a.split("/").filter(v).map(decodeURIComponent):a.split("/").map(decodeURIComponent):[],i=""!==t?g(t):{},u=""!==n?decodeURIComponent(n.substring(1)):null,l="/"+o.map(encodeURIComponent).join("/"),h=w(i),f=null!=u?"#"+encodeURIComponent(u):"",p=l+h+f;return s({key:c.default(l)+"-"+c.default(h+f),path:o,search:i},null!==u&&{hash:u},{raw:{path:l,search:h,hash:f},toString:function(){return p}})},k=new Set,O="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.createBrowserHistory():r.createMemoryHistory(),x=S(O.location,!0),P=!1;O.listen(function(e){var r=S(e.location,!1);if(r.toString()!==x.toString()){P=!0;var t=r.raw.search!==x.raw.search,n=t?{}:x.search;if(t)for(var a in r.search)if(Object.prototype.hasOwnProperty.call(r.search,a)){var o=r.search[a];if(null==o)continue;var i=x.search[a];n[a]=null!=i&&"string"!=typeof i&&"string"!=typeof o&&y(o,i)?i:o}x=s({key:r.key,path:r.raw.path!==x.raw.path?r.path:x.path,search:n},null!=r.hash&&{hash:r.hash},{raw:r.raw,toString:r.toString}),k.forEach(function(e){return e(x)})}});var j=function(e){return k.add(e),function(){k.delete(e)}},C=function(){return x},R=u.createContext(C),U=R.Provider,I=function(){return u.useContext(R)},E=function(e){var t=r.parsePath(e),n=t.pathname,a=t.search,o=t.hash;O.push({pathname:void 0===n?"":n,search:void 0===a?"":a,hash:void 0===o?"":o})},A=function(e){var t=r.parsePath(e),n=t.pathname,a=t.search,o=t.hash;O.replace({pathname:void 0===n?"":n,search:void 0===a?"":a,hash:void 0===o?"":o})},N=function(e){var n=e.href,a=e.replace,o=void 0!==a&&a,i=e.target,c=u.useMemo(function(){return r.parsePath(n).pathname},[n]),s=I(),l=function(){return c===s().raw.path},h=t.useSyncExternalStore(j,l,l),f=o||h,p=null==i||"_self"===i;return{active:h,onClick:u.useCallback(function(e){e.defaultPrevented||!p||0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),f?A(n):E(n))},[f,p,n])}},L=["onClick","className","replace","style","target","to","activeClassName","activeStyle"],q=u.forwardRef(function(e,r){var t=e.onClick,n=e.className,a=e.replace,o=e.style,i=e.target,c=e.to,l=e.activeClassName,h=e.activeStyle,f=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r.indexOf(t=o[n])>=0||(a[t]=e[t]);return a}(e,L),p=N({href:c,replace:a,target:i}),v=p.active,d=p.onClick;return u.createElement("a",s({},f,{ref:r,href:c,onClick:function(e){null==t||t(e),d(e)},target:i,className:v&&null!=l?null==n?l:n+" "+l:n,style:v&&null!=h?null==o?h:s({},o,h):o}))});q.displayName="Link";var T=function(e,r){return""===e?e:r+e},M=function(e){return"/"===e[0]?e:"/"+e},W=function(e){var t=r.parsePath(e),n=t.pathname,a=t.search,o=t.hash,i=void 0===o?"":o;return{path:void 0===n?"":n,search:(void 0===a?"":a).substring(1),hash:i.substring(1)}},K=function(e,r){var t=M(e.path),n=M(r.path),a="/"===t?n:"/"===n?t:t+n,o=""===e.search?r.search:e.search+T(r.search,"&"),i=""===r.hash?e.hash:r.hash;return a+T(o,"?")+T(i,"#")},_=function(e,t){var n,a=r.parsePath(t),o=a.pathname,i=void 0===o?"/":o,u=a.search,c=a.hash,s=i.endsWith("/*"),l=function(e){for(var r,t=e.split("/").filter(v),n=[],a=t.length>0?4*t.length:5,o=h(t);!(r=o()).done;){var i=r.value,u=d(i);a+=u?2:3,n.push(u?{name:i.substring(1)}:encodeURIComponent(i))}return{ranking:a,path:n}}(s?i.slice(0,-2):i),f=l.ranking,p={isArea:s,name:e,ranking:s?f-1:f,path:l.path,search:void 0,hash:void 0};if(null!=u){p.search={};for(var y,m=h(new URLSearchParams(u.substring(1)));!(y=m()).done;){var g=y.value[0];(n=g).startsWith(":")&&n.endsWith("[]")?p.search[g.substring(1,g.length-2)]="multiple":d(g)&&(p.search[g.substring(1,g.length)]="unique")}}return null!=c&&d(c.substring(1))&&(p.hash=c.substring(2)),p},B=function(e,r){var t=e.path,n=r.isArea,a=r.path;if(!(!n&&t.length!==a.length||n&&t.length<a.length)){for(var o={},i=0;i<a.length;i++){var u=t[i],c=a[i];if(null!=c)if("string"==typeof c){if(c!==u)return}else{if(null==u)return;o[c.name]=u}}for(var s in r.search)if(Object.prototype.hasOwnProperty.call(r.search,s)){var l=r.search[s],h=e.search[s];if(null==l||null==h)continue;if("multiple"===l){o[s]="string"==typeof h?[h]:h;continue}"string"==typeof h?o[s]=h:null!=h[0]&&(o[s]=h[0])}return null!=r.hash&&null!=e.hash&&(o[r.hash]=e.hash),o}},D=function(e,r){for(var t,n=h(r);!(t=n()).done;){var a=t.value,o=B(e,a);if(null!=o)return{key:e.key,name:a.name,params:o}}},H=function(e,r){void 0===r&&(r={});var t="/"+e.path.map(function(e){return encodeURIComponent("string"==typeof e?e:String(r[e.name]))}).join("/"),n="",a="";if(null!=e.search){var o={};for(var i in r){var u=r[i];Object.prototype.hasOwnProperty.call(r,i)&&Object.prototype.hasOwnProperty.call(e.search,i)&&null!=u&&(o[i]=u)}n=w(o)}if(null!=e.hash){var c=r[e.hash];"string"==typeof c&&(a="#"+encodeURIComponent(c))}return{pathname:t,search:n,hash:a}},F={A:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0};exports.Link=q,exports.ServerUrlProvider=function(e){var t=e.children,n=r.parsePath(e.value),a=n.pathname,o=n.search,i=n.hash,c=S({pathname:void 0===a?"/":a,search:void 0===o?"":o,hash:void 0===i?"":i},!1);return u.createElement(U,{children:t,value:function(){return c}})},exports.createGroup=function(e,r,t){var n=W(r),a={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(a[e+o]=K(n,W(t[o])));return a},exports.createRouter=function(e,t){void 0===t&&(t={});var n=t.basePath,o=void 0===n?"":n,i={path:W(o).path,search:"",hash:""},c={},l=[];for(var h in e)if(Object.prototype.hasOwnProperty.call(e,h)){var v=_(h,""!==o?K(i,W(e[h])):e[h]);c[h]=v,l.push(v)}l.sort(function(e,r){return r.ranking-e.ranking});for(var d={},y=function(){var e=l[g];if(null!=e&&!e.isArea){var t=e.name;d[t]=function(e){return r.createPath(H(c[t],e))}}},g=0;g<l.length;g++)y();return s({useRoute:function(e){var r=JSON.stringify(e),t=u.useMemo(function(){return l.filter(function(r){return e.includes(r.name)})},[r]),n=I(),o=function(){return D(n(),t)};return a.useSyncExternalStoreWithSelector(j,o,o,p,m)},getRoute:function(e){var r=C(),t=l.filter(function(r){return e.includes(r.name)});return D(r,t)},push:function(e){return O.push(H(c[e],f([].slice.call(arguments,1))))},replace:function(e){return O.replace(H(c[e],f([].slice.call(arguments,1))))}},d)},exports.decodeSearch=g,exports.encodeSearch=w,exports.getLocation=C,exports.pushUnsafe=E,exports.replaceUnsafe=A,exports.subscribeToLocation=j,exports.useFocusReset=function(e){var r=e.route,t=e.containerRef,n=null==r?void 0:r.key.split("-")[0];u.useEffect(function(){var e=t.current;if(e&&P)try{null!=e.getAttribute("tabIndex")||F[e.nodeName]||e.setAttribute("tabIndex","-1"),e.focus()}catch(e){}},[t,n])},exports.useLinkProps=N,exports.useLocation=function(){var e=I();return t.useSyncExternalStore(j,e,e)},exports.useNavigationBlocker=function(e,r){u.useEffect(function(){if(e){var t=O.block(function(e){window.confirm(r)&&(t(),e.retry())});return t}},[e])};
//# sourceMappingURL=index.js.map
{
"name": "@swan-io/chicane",
"version": "1.4.0",
"version": "1.4.1",
"license": "MIT",

@@ -37,3 +37,3 @@ "description": "A simple and safe router for React and TypeScript",

"test:watch": "vitest --watch",
"typecheck": "tsc --noEmit && vitest typecheck --watch=false",
"typecheck": "tsc --noEmit",
"prepack": "yarn typecheck && yarn lint && yarn test && yarn build"

@@ -59,10 +59,10 @@ },

"@testing-library/react": "^12.1.5",
"@types/react": "^17.0.59",
"@types/react": "^17.0.62",
"@types/react-dom": "^17.0.20",
"@types/use-sync-external-store": "^0.0.3",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
"eslint": "^8.41.0",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"eslint": "^8.43.0",
"eslint-plugin-react-hooks": "^4.6.0",
"jsdom": "^22.0.0",
"jsdom": "^22.1.0",
"microbundle": "^0.15.1",

@@ -73,5 +73,5 @@ "prettier": "^2.8.8",

"react-dom": "^17.0.2",
"typescript": "^5.0.4",
"vitest": "^0.31.1"
"typescript": "^5.1.3",
"vitest": "^0.32.2"
}
}

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