Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/router / src / deps / routes.ts
Size: Mime:
/**
 * we may have things like route-here/:named?optional
 * this way we can get them by name easily
 */
import { config } from '../config'
import { RoutePathObjType } from '../typings'

const routePathCurrent = Object.seal({
  path: '',
  exact: true,
  strict: false,
})

/**
 * @modifies routePaths
 */
const routeToAttributes = (route: RoutePathObjType) => {
  const attributes = {
    key: route.path,
    // exact: route.exact,
    path: route.path,
    component: route.component,
  }

  config.get('routePathsList').push(route.path)
  return attributes
}

export { routeToAttributes, routePathCurrent }