@capri-js/preact-router
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -1,1 +0,1 @@ | ||
var e=require("preact"),a=require("preact-router"),r=["className","activeClass","activeClassName","path"];function t(e){var r=a.useRouter()[0];return e.children({url:r.url,path:r.path,matches:!1!==a.exec(r.path||r.url,e.path,{})})}t.Link=function(t){var s=t.className,u=t.activeClass,c=t.activeClassName,l=t.path,n=function(e,a){if(null==e)return{};var r,t,s={},u=Object.keys(e);for(t=0;t<u.length;t++)a.indexOf(r=u[t])>=0||(s[r]=e[r]);return s}(t,r),i=a.useRouter()[0],h=l&&i.path&&a.exec(i.path,l,{})||a.exec(i.url,n.href,{}),p=n.class||s||"",o=h&&(u||c)||"";return n.class=p+(p&&o&&" ")+o,e.h(a.Link,n)},module.exports=t; | ||
var e=require("preact"),a=require("@capri-js/preact-router"),r=["className","activeClass","activeClassName","path"];function t(e){var r=a.useRouter()[0];return e.children({url:r.url,path:r.path,matches:!1!==a.exec(r.path||r.url,e.path,{})})}t.Link=function(t){var s=t.className,c=t.activeClass,u=t.activeClassName,l=t.path,n=function(e,a){if(null==e)return{};var r,t,s={},c=Object.keys(e);for(t=0;t<c.length;t++)a.indexOf(r=c[t])>=0||(s[r]=e[r]);return s}(t,r),i=a.useRouter()[0],h=l&&i.path&&a.exec(i.path,l,{})||a.exec(i.url,n.href,{}),p=n.class||s||"",o=h&&(c||u)||"";return n.class=p+(p&&o&&" ")+o,e.h(a.Link,n)},module.exports=t; |
@@ -1,1 +0,1 @@ | ||
import{h as a}from"preact";import{useRouter as t,exec as r,Link as e}from"preact-router";var s=["className","activeClass","activeClassName","path"];function l(a){var e=t()[0];return a.children({url:e.url,path:e.path,matches:!1!==r(e.path||e.url,a.path,{})})}function c(l){var c=l.className,n=l.activeClass,u=l.activeClassName,i=l.path,p=function(a,t){if(null==a)return{};var r,e,s={},l=Object.keys(a);for(e=0;e<l.length;e++)t.indexOf(r=l[e])>=0||(s[r]=a[r]);return s}(l,s),h=t()[0],f=i&&h.path&&r(h.path,i,{})||r(h.url,p.href,{}),o=p.class||c||"",m=f&&(n||u)||"";return p.class=o+(o&&m&&" ")+m,a(e,p)}export{c as Link,l as Match,l as default}; | ||
import{h as a}from"preact";import{useRouter as r,exec as t,Link as e}from"@capri-js/preact-router";var s=["className","activeClass","activeClassName","path"];function c(a){var e=r()[0];return a.children({url:e.url,path:e.path,matches:!1!==t(e.path||e.url,a.path,{})})}function l(c){var l=c.className,n=c.activeClass,i=c.activeClassName,p=c.path,u=function(a,r){if(null==a)return{};var t,e,s={},c=Object.keys(a);for(e=0;e<c.length;e++)r.indexOf(t=c[e])>=0||(s[t]=a[t]);return s}(c,s),h=r()[0],f=p&&h.path&&t(h.path,p,{})||t(h.url,u.href,{}),o=u.class||l||"",m=f&&(n||i)||"";return u.class=o+(o&&m&&" ")+m,a(e,u)}export{l as Link,c as Match,c as default}; |
@@ -11,4 +11,4 @@ { | ||
"preact": "*", | ||
"preact-router": "*" | ||
"@capri-js/preact-router": "*" | ||
} | ||
} |
import { h } from 'preact'; | ||
import { Link as StaticLink, exec, useRouter } from 'preact-router'; | ||
import { Link as StaticLink, exec, useRouter } from '@capri-js/preact-router'; | ||
@@ -4,0 +4,0 @@ export function Match(props) { |
{ | ||
"name": "@capri-js/preact-router", | ||
"amdName": "preactRouter", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "Connect your components up to that address bar.", | ||
@@ -6,0 +6,0 @@ "main": "dist/preact-router.js", |
Sorry, the diff of this file is not supported yet
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
82745