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

bypath

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bypath - npm Package Compare versions

Comparing version 0.7.1 to 0.7.2

4

babel-preset.js

@@ -8,5 +8,5 @@ module.exports = function () {

noDefaults: true,
factories: ['framework'],
factories: ['bypath'],
},
'framework',
'bypath',
],

@@ -13,0 +13,0 @@ ],

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

((e,t)=>{'object'==typeof exports&&'undefined'!=typeof module?t(exports,require('@loadable/component'),require('react-router-config'),require('effector'),require('history')):'function'==typeof define&&define.amd?define(['exports','@loadable/component','react-router-config','effector','history'],t):t((e='undefined'!=typeof globalThis?globalThis:e||self).framework={},e.loadable,e.ReactRouterConfig,e.effector,e.History)})(this,((e,t,r,effector,a)=>{function o(e){return e&&'object'==typeof e&&'default'in e?e:{default:e}}function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((t=>Object.getOwnPropertyDescriptor(e,t).enumerable))),r.push.apply(r,a)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),1).forEach((t=>{c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:1,configurable:1,writable:1}):e[t]=r,e}function s(e){var{source:t,cases:r}=e,a={},o=effector.is.store(t,{name:"current",sid:"-htjkz7"})?t.updates:t;for(var n in r)n in r&&(()=>{var e=r[n];a[n]=o.filterMap(e),o=o.filter({fn:t=>!e(t)})})();return a.__=o,a}function d(e){return e[h]}var u=o(t);const f=effector.createDomain('framework/default',{name:"defaultDomain",sid:"-tzcbvc"}),h='framework/page-hatch';Object.defineProperty(e,'loadable',{enumerable:1,get:()=>u.default}),e.contract=e=>{for(const t in e.page){const r=e.page[t],a=e.model[t];r&&a&&effector.is.unit(r)&&effector.is.unit(a)&&(effector.is.store(r,{sid:"xrdgy2"})&&effector.is.store(a,{sid:"xrdih6"})?(effector.forward({and:{from:a,to:r},or:{sid:"m1otzj"}}),r.defaultState=a.defaultState,r.stateRef.current=a.stateRef.current,r.stateRef.before=[{type:'map',fn:e=>e,from:a.stateRef}]):effector.forward({and:{from:r,to:a},or:{sid:"n1fgk0"}}))}},e.createBrowserApplication=e=>{const t=e.domain||f,o=((e,{emitHistory:t=0,trackRedirects:r=0}={})=>{const o='undefined'!=typeof document?a.createBrowserHistory():a.createMemoryHistory(),n=e.createEffect((()=>{}),{name:"historyPush",sid:"ph1zyv"}),i=e.createEffect((()=>{}),{name:"historyPushSearch",sid:"yxzraw"}),c=e.createEffect((()=>{}),{name:"historyReplace",sid:"-pcfgpo"}),s=e.createEvent({name:"historyChanged",sid:"-yqk2kz"}),d=e.createEvent({name:"historyEmitCurrent",sid:"nhk4d5"}),u=e.createStore('',{name:"$redirectTo",sid:"581zmv"});return effector.sample({and:[{clock:d,fn:()=>({action:'REPLACE',hash:o.location.hash,pathname:o.location.pathname,search:o.location.search}),target:s}],or:{sid:"km8cdb"}}),t&&(n.use((e=>o.push(e))),c.use((e=>o.replace(e))),i.use((e=>o.push({search:e}))),d.watch((()=>{let e;try{e=effector.scopeBind(s)}catch(t){e=e=>s(e)}o.listen((({pathname:t,search:r,hash:a},o)=>{e({pathname:t,search:r,hash:a,action:o})}))}))),r&&(u.on([n,c],((e,t)=>t)),t&&u.on(s,((e,{pathname:t,search:r})=>`${t}?${r}`))),{history:o,historyPush:n,historyPushSearch:i,historyReplace:c,historyChanged:s,historyEmitCurrent:d,$redirectTo:u}})(t,{emitHistory:1});effector.forward({and:{from:e.ready,to:o.historyEmitCurrent},or:{sid:"-yp3wn8"}});const n=o.historyChanged.filterMap((t=>{const a=r.matchRoutes(e.routes,t.pathname);if(a.length>0)return i(i({},a[0]),{},{change:t})}));for(const{component:r,path:a}of e.routes){if(!r)continue;if(r.load)throw new Error(`[${a}] lazy components temporary is not supported. Please, remove loadable() call`);const{routeMatched:e,__:o}=effector.withFactory({sid:"vzt7q4",fn:()=>s({source:n,cases:{routeMatched:({route:e,match:t,change:r})=>{if(e.path===a)return{params:t.params,query:Object.fromEntries(new URLSearchParams(r.search))}}}}),name:"none",method:"splitMap"}),i=t.createEvent({name:`hatchEnter:${a}`},{name:"hatchEnter",sid:"-e9ffs9"}),c=t.createEvent({name:`hatchUpdate:${a}`},{name:"hatchUpdate",sid:"y0vldw"}),u=t.createEvent({name:`hatchExit:${a}`},{name:"hatchExit",sid:"-733nio"}),f=d(r);f&&(effector.forward({and:{from:i,to:f.enter},or:{sid:"-we2yy9"}}),effector.forward({and:{from:c,to:f.update},or:{sid:"-wdj6cw"}}),effector.forward({and:{from:u,to:f.exit},or:{sid:"-wczdrj"}}));const h=t.createStore(0,{and:{name:`$onRoute:${a}`},name:"$onRoute",sid:"ly7iyy"}),m=t.createStore(0,{and:{name:`$onPage:${a}`},name:"$onPage",sid:"kdm6x2"});h.on(e,(()=>1)),effector.guard({and:[{clock:e,filter:m,target:c}],or:{sid:"-vuadmz"}}),effector.guard({and:[{clock:e,filter:effector.combine({and:[m,h,(e,t)=>!e&&t],or:{name:"filter",sid:"8acmah"}}),target:i}],or:{sid:"-vffxm8"}}),m.on(i,(()=>1)),h.on(o,(()=>0)),effector.guard({and:[{clock:o,filter:m,target:u}],or:{sid:"-uxaq1b"}}),m.on(u,(()=>0))}return{navigation:o}},e.createHatch=(e=f)=>{var t,r,a;let o,n;effector.is.domain(e,{sid:"d6uzry"})?(o=e,n={}):effector.is.domain(e.domain,{sid:"-fuus8v"})?(o=e.domain,n=e):(o=f,n={});const i=o.createStore(Boolean(0),{name:"$opened",sid:"nsf3zm"}),c=o.createStore({},{name:"$params",sid:"7jlluc"}),s=o.createStore({},{name:"$query",sid:"-h3y3q"}),d={enter:null!==(t=n.enter)&&void 0!==t?t:o.createEvent({name:"enter",sid:"-hoeep"}),update:null!==(r=n.update)&&void 0!==r?r:o.createEvent({name:"update",sid:"-e6k2lh"}),exit:null!==(a=n.exit)&&void 0!==a?a:o.createEvent({name:"exit",sid:"36qrk9"}),$opened:i,$params:c,$query:s,$props:effector.combine({and:[{params:c,query:s}],or:{name:"$props",sid:"-kba9zb"}})};return c.on([d.enter,d.update],((e,{params:t})=>t)),s.on([d.enter,d.update],((e,{query:t})=>t)),d.$opened.on(d.enter,(()=>Boolean(1))).reset(d.exit),d},e.createPages=e=>r.renderRoutes(e),e.getHatch=d,e.lookupHatch=e=>{if(e.route.component)return d(e.route.component)},e.withHatch=(e,t)=>(t[h]=e,t),Object.defineProperty(e,'__esModule',{value:1})}));
((e,t)=>{'object'==typeof exports&&'undefined'!=typeof module?t(exports,require('@loadable/component'),require('react-router-config'),require('effector'),require('history')):'function'==typeof define&&define.amd?define(['exports','@loadable/component','react-router-config','effector','history'],t):t((e='undefined'!=typeof globalThis?globalThis:e||self).bypath={},e.loadable,e.ReactRouterConfig,e.effector,e.History)})(this,((e,t,r,effector,a)=>{function o(e){return e&&'object'==typeof e&&'default'in e?e:{default:e}}function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((t=>Object.getOwnPropertyDescriptor(e,t).enumerable))),r.push.apply(r,a)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),1).forEach((t=>{c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:1,configurable:1,writable:1}):e[t]=r,e}function s(e){var{source:t,cases:r}=e,a={},o=effector.is.store(t,{name:"current",sid:"-htjkz7"})?t.updates:t;for(var n in r)n in r&&(()=>{var e=r[n];a[n]=o.filterMap(e),o=o.filter({fn:t=>!e(t)})})();return a.__=o,a}function d(e){return e[h]}var u=o(t);const f=effector.createDomain('framework/default',{name:"defaultDomain",sid:"-tzcbvc"}),h='framework/page-hatch';Object.defineProperty(e,'loadable',{enumerable:1,get:()=>u.default}),e.contract=e=>{for(const t in e.page){const r=e.page[t],a=e.model[t];r&&a&&effector.is.unit(r)&&effector.is.unit(a)&&(effector.is.store(r,{sid:"xrdgy2"})&&effector.is.store(a,{sid:"xrdih6"})?(effector.forward({and:{from:a,to:r},or:{sid:"m1otzj"}}),r.defaultState=a.defaultState,r.stateRef.current=a.stateRef.current,r.stateRef.before=[{type:'map',fn:e=>e,from:a.stateRef}]):effector.forward({and:{from:r,to:a},or:{sid:"n1fgk0"}}))}},e.createBrowserApplication=e=>{const t=e.domain||f,o=((e,{emitHistory:t=0,trackRedirects:r=0}={})=>{const o='undefined'!=typeof document?a.createBrowserHistory():a.createMemoryHistory(),n=e.createEffect((()=>{}),{name:"historyPush",sid:"ph1zyv"}),i=e.createEffect((()=>{}),{name:"historyPushSearch",sid:"yxzraw"}),c=e.createEffect((()=>{}),{name:"historyReplace",sid:"-pcfgpo"}),s=e.createEvent({name:"historyChanged",sid:"-yqk2kz"}),d=e.createEvent({name:"historyEmitCurrent",sid:"nhk4d5"}),u=e.createStore('',{name:"$redirectTo",sid:"581zmv"});return effector.sample({and:[{clock:d,fn:()=>({action:'REPLACE',hash:o.location.hash,pathname:o.location.pathname,search:o.location.search}),target:s}],or:{sid:"km8cdb"}}),t&&(n.use((e=>o.push(e))),c.use((e=>o.replace(e))),i.use((e=>o.push({search:e}))),d.watch((()=>{let e;try{e=effector.scopeBind(s)}catch(t){e=e=>s(e)}o.listen((({pathname:t,search:r,hash:a},o)=>{e({pathname:t,search:r,hash:a,action:o})}))}))),r&&(u.on([n,c],((e,t)=>t)),t&&u.on(s,((e,{pathname:t,search:r})=>`${t}?${r}`))),{history:o,historyPush:n,historyPushSearch:i,historyReplace:c,historyChanged:s,historyEmitCurrent:d,$redirectTo:u}})(t,{emitHistory:1});effector.forward({and:{from:e.ready,to:o.historyEmitCurrent},or:{sid:"-yp3wn8"}});const n=o.historyChanged.filterMap((t=>{const a=r.matchRoutes(e.routes,t.pathname);if(a.length>0)return i(i({},a[0]),{},{change:t})}));for(const{component:r,path:a}of e.routes){if(!r)continue;if(r.load)throw new Error(`[${a}] lazy components temporary is not supported. Please, remove loadable() call`);const{routeMatched:e,__:o}=effector.withFactory({sid:"vzt7q4",fn:()=>s({source:n,cases:{routeMatched:({route:e,match:t,change:r})=>{if(e.path===a)return{params:t.params,query:Object.fromEntries(new URLSearchParams(r.search))}}}}),name:"none",method:"splitMap"}),i=t.createEvent({name:`hatchEnter:${a}`},{name:"hatchEnter",sid:"-e9ffs9"}),c=t.createEvent({name:`hatchUpdate:${a}`},{name:"hatchUpdate",sid:"y0vldw"}),u=t.createEvent({name:`hatchExit:${a}`},{name:"hatchExit",sid:"-733nio"}),f=d(r);f&&(effector.forward({and:{from:i,to:f.enter},or:{sid:"-we2yy9"}}),effector.forward({and:{from:c,to:f.update},or:{sid:"-wdj6cw"}}),effector.forward({and:{from:u,to:f.exit},or:{sid:"-wczdrj"}}));const h=t.createStore(0,{and:{name:`$onRoute:${a}`},name:"$onRoute",sid:"ly7iyy"}),m=t.createStore(0,{and:{name:`$onPage:${a}`},name:"$onPage",sid:"kdm6x2"});h.on(e,(()=>1)),effector.guard({and:[{clock:e,filter:m,target:c}],or:{sid:"-vuadmz"}}),effector.guard({and:[{clock:e,filter:effector.combine({and:[m,h,(e,t)=>!e&&t],or:{name:"filter",sid:"8acmah"}}),target:i}],or:{sid:"-vffxm8"}}),m.on(i,(()=>1)),h.on(o,(()=>0)),effector.guard({and:[{clock:o,filter:m,target:u}],or:{sid:"-uxaq1b"}}),m.on(u,(()=>0))}return{navigation:o}},e.createHatch=(e=f)=>{var t,r,a;let o,n;effector.is.domain(e,{sid:"d6uzry"})?(o=e,n={}):effector.is.domain(e.domain,{sid:"-fuus8v"})?(o=e.domain,n=e):(o=f,n={});const i=o.createStore(Boolean(0),{name:"$opened",sid:"nsf3zm"}),c=o.createStore({},{name:"$params",sid:"7jlluc"}),s=o.createStore({},{name:"$query",sid:"-h3y3q"}),d={enter:null!==(t=n.enter)&&void 0!==t?t:o.createEvent({name:"enter",sid:"-hoeep"}),update:null!==(r=n.update)&&void 0!==r?r:o.createEvent({name:"update",sid:"-e6k2lh"}),exit:null!==(a=n.exit)&&void 0!==a?a:o.createEvent({name:"exit",sid:"36qrk9"}),$opened:i,$params:c,$query:s,$props:effector.combine({and:[{params:c,query:s}],or:{name:"$props",sid:"-kba9zb"}})};return c.on([d.enter,d.update],((e,{params:t})=>t)),s.on([d.enter,d.update],((e,{query:t})=>t)),d.$opened.on(d.enter,(()=>Boolean(1))).reset(d.exit),d},e.createPages=e=>r.renderRoutes(e),e.getHatch=d,e.lookupHatch=e=>{if(e.route.component)return d(e.route.component)},e.withHatch=(e,t)=>(t[h]=e,t),Object.defineProperty(e,'__esModule',{value:1})}));
//# sourceMappingURL=bypath.umd.js.map
{
"name": "bypath",
"version": "0.7.1",
"version": "0.7.2",
"description": "Build effector and react applications with ease",

@@ -5,0 +5,0 @@ "main": "dist/bypath.cjs.js",

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