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

@jackgreen/react-router-view

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jackgreen/react-router-view - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

dist/index.cjs.js

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

"use strict";var e,t=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-router-dom"),n=function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};module.exports=function(e){var o=e.routes;return t.createElement(r.Switch,null,o.map((function(e){e.component,e.childRoutes;var o=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["component","childRoutes"]);return t.createElement(r.Route,n({key:e.path},o,{render:function(r){return t.createElement(e.component,n({},r,{routes:e.childRoutes}))}}))})))};
"use strict";var e,t=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-router-dom"),n=function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};module.exports=function(e){var o=e.routes;return t.createElement(r.Switch,null,o.map((function(e){e.component,e.childRoutes;var o=e.redirect,c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["component","childRoutes","redirect"]);return"string"==typeof o&&""!==o?t.createElement(r.Redirect,n({key:e.path},c,{to:o})):t.createElement(r.Route,n({key:e.path},c,{render:function(r){return t.createElement(e.component,n({},r,{routes:e.childRoutes}))}}))})))};

@@ -1,15 +0,9 @@

/**
* 参考
* react route config
* https://reacttraining.com/react-router/web/example/route-config
* vue-router
* https://router.vuejs.org/zh/
*/
import React from 'react';
/// <reference types="react" />
import { RouteProps } from 'react-router';
export interface RouteConfig extends RouteProps {
path: string;
component: React.ComponentType<any>;
component?: any;
childRoutes?: RouteConfig[];
redirect?: string;
}
export default function ReactRouterView(props: any): JSX.Element;

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

import t from"react";import{Switch as e,Route as r}from"react-router-dom";
import e from"react";import{Switch as t,Redirect as r,Route as n}from"react-router-dom";
/*! *****************************************************************************

@@ -15,2 +15,2 @@ Copyright (c) Microsoft Corporation.

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};export default function(o){var c=o.routes;return t.createElement(e,null,c.map((function(e){e.component,e.childRoutes;var o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(e,["component","childRoutes"]);return t.createElement(r,n({key:e.path},o,{render:function(r){return t.createElement(e.component,n({},r,{routes:e.childRoutes}))}}))})))}
***************************************************************************** */var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};export default function(c){var a=c.routes;return e.createElement(t,null,a.map((function(t){t.component,t.childRoutes;var c=t.redirect,a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(t,["component","childRoutes","redirect"]);return"string"==typeof c&&""!==c?e.createElement(r,o({key:t.path},a,{to:c})):e.createElement(n,o({key:t.path},a,{render:function(r){return e.createElement(t.component,o({},r,{routes:t.childRoutes}))}}))})))}

@@ -16,2 +16,2 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("react-router-dom")):"function"==typeof define&&define.amd?define(["react","react-router-dom"],t):(e=e||self).ReactRouterView=t(e.React,e.ReactRouterDom)}(this,(function(e,t){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;

***************************************************************************** */
var r=function(){return(r=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};return function(o){var n=o.routes;return e.createElement(t.Switch,null,n.map((function(o){o.component,o.childRoutes;var n=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(o,["component","childRoutes"]);return e.createElement(t.Route,r({key:o.path},n,{render:function(t){return e.createElement(o.component,r({},t,{routes:o.childRoutes}))}}))})))}}));
var r=function(){return(r=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};return function(o){var n=o.routes;return e.createElement(t.Switch,null,n.map((function(o){o.component,o.childRoutes;var n=o.redirect,c=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(o,["component","childRoutes","redirect"]);return"string"==typeof n&&""!==n?e.createElement(t.Redirect,r({key:o.path},c,{to:n})):e.createElement(t.Route,r({key:o.path},c,{render:function(t){return e.createElement(o.component,r({},t,{routes:o.childRoutes}))}}))})))}}));
{
"name": "@jackgreen/react-router-view",
"version": "1.0.0",
"version": "1.1.0",
"private": false,

@@ -5,0 +5,0 @@ "main": "dist/index.min.js",

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