Skip to content
This repository has been archived by the owner on Nov 19, 2022. It is now read-only.

esender/bushido

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Climate

Test Coverage

Issue Count

Bushido

Very simple and laconic path helper

Usage

// paths.js
import Bushido, { addResource } from 'bushido';

let bushido = new Bushido();

export default bushido.createPaths([
  addResource('books', [
    addResource('pages', [
      addResource('paragraphs')
    ]),
    addResource('content')
  ]),
  addResource('pages')
]);
import paths from './paths'

paths.pages.path // => '/pages'
paths.pages(4).path // => '/pages/4'

paths.books.pages.paragraphs.path // => '/books/pages/paragraphs'
paths.books(3).pages(5).paragraphs(7).path // => '/books/3/pages/5/paragraphs/7'
paths.books(6).pages.paragraphs.path // => '/books/6/pages/paragraphs'

About

Very simple and laconic path helper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published