New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

routr

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

routr - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

25

lib/router.js

@@ -41,3 +41,3 @@ /**

/**
* Checkes whether this route matches the given path, method (GET as default) and optionally navParams.
* Checkes whether this route matches the given path, method (GET as default) and optionally navigation related criteria.
* @method match

@@ -47,3 +47,5 @@ * @param {String} path The url path to be matched to this route

* @param {String} [options.method=get] The case-insensitive HTTP method string. Defaults to 'get'.
* @param {Object} [options.navParams] The navigation params (that are not part of the path).
* @param {Object} [options.navigate] The navigation info.
* @param {Object} [options.navigate.type] The navigation type: 'pageload', 'click', 'popstate'.
* @param {Object} [options.navigate.params] The navigation params (that are not part of the path).
* @return {Object|null} The matched route params if path/method/navParams matches to this route; null otherwise.

@@ -66,5 +68,3 @@ * @for Route

key,
pattern,
i,
len;
pattern;

@@ -86,6 +86,6 @@ options = options || {};

// 3. check navParams, if this route has match requirements defined for navParams
navParamsConfig = self.config.navParams;
navParamsConfig = (self.config.navigate && self.config.navigate.params);
if (navParamsConfig) {
navParamConfigKeys = Object.keys(navParamsConfig);
navParams = options.navParams || {};
navParams = (options.navigate && options.navigate.params) || {};
for (i = 0, len = navParamConfigKeys.length; i < len; i++) {

@@ -110,3 +110,3 @@ // for each navParam defined in the route config, make sure

routeParams = {};
for (i = 0, len = self.keys.length; i < len; i++) {
for (var i = 0, len = self.keys.length; i < len; i++) {
routeParams[self.keys[i].name] = pathMatches[i+1];

@@ -179,4 +179,6 @@ }

* @param {String} [options.method=get] The case-insensitive HTTP method string.
* @param {Object} [options.navParams] The navigation params (that are not part of the path).
* @return {Object|null} The matched route info if path/method/navParams matches to a route; null otherwise.
* @param {Object} [options.navigate] The navigation info.
* @param {Object} [options.navigate.type] The navigation type: 'pageload', 'click', 'popstate'.
* @param {Object} [options.navigate.params] The navigation params (that are not part of the path).
* @return {Object|null} The matched route info if path/method/navigate.params matches to a route; null otherwise.
*/

@@ -199,3 +201,4 @@ Router.prototype.getRoute = function (path, options) {

params: match,
config: route.config
config: route.config,
navigate: options && options.navigate
};

@@ -202,0 +205,0 @@ }

{
"name": "routr",
"version": "0.0.1",
"version": "0.0.2",
"description": "A router for both server and client",

@@ -8,3 +8,3 @@ "main": "index.js",

"type": "git",
"url": "git://github.com/ouchtown/routr.git"
"url": "git://github.com/yahoo/routr.git"
},

@@ -20,3 +20,3 @@ "scripts": {

"type": "BSD",
"url": "https://github.com/ouchtown/routr/blob/master/LICENSE.md"
"url": "https://github.com/yahoo/routr/blob/master/LICENSE.md"
}

@@ -40,4 +40,5 @@ ],

"keywords": [
"yahoo",
"router"
]
}

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

Routr [![Build Status](https://travis-ci.org/ouchtown/routr.svg?branch=master)](https://travis-ci.org/ouchtown/routr) [![Dependency Status](https://david-dm.org/ouchtown/routr.svg)](https://david-dm.org/ouchtown/routr)
Routr [![Build Status](https://travis-ci.org/yahoo/routr.svg?branch=master)](https://travis-ci.org/yahoo/routr) [![Dependency Status](https://david-dm.org/yahoo/routr.svg)](https://david-dm.org/yahoo/routr)
=========

@@ -8,3 +8,3 @@

-----
For more detailed examples, please check out [example applications](https://github.com/ouchtown/routr/tree/master/examples);
For more detailed examples, please check out [example applications](https://github.com/yahoo/routr/tree/master/examples);

@@ -53,5 +53,5 @@ ```

[LICENSE file]: https://github.com/ouchtown/routr/blob/master/LICENSE.md
[LICENSE file]: https://github.com/yahoo/routr/blob/master/LICENSE.md
Third-pary open source code used are listed in our [package.json file]( https://github.com/ouchtown/routr/blob/master/package.json).
Third-pary open source code used are listed in our [package.json file]( https://github.com/yahoo/routr/blob/master/package.json).
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