0.0.10 • Published 9 years ago

froute-picker v0.0.10

Weekly downloads
31
License
-
Repository
github
Last release
9 years ago

froute-picker Build Status npm version Dependency Status

froute-picker is a "picking" and "matching" module used by froute. It picks parameters from url templates matches urls to the templates while assigning parameter values.

Getting started

Using npm

npm install froute-picker
var picker = require("froute-picker");

Example

Picking parameters from a url template and matching a url to the template

var template = "/apple/{type}/size/{size}",
    picked = picker.pick(template),
    matchUrl = picker.match("/apple/gala/size/large");
    result = matchUrl(picked);

expect(result).not.toBeNull();
expect(result.type).toEqual("gala");
expect(result.size).toEqual("large");
0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

11 years ago

0.0.1

11 years ago