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

route-node

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

route-node - npm Package Compare versions

Comparing version 1.11.0 to 2.0.0

dist/cjs/route-node.js

9

CHANGELOG.md

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

<a name="2.0.0"></a>
# [2.0.0](https://github.com/troch/route-node/compare/v1.11.0...v2.0.0) (2017-11-16)
### Breaking changes
* AMD build no longer provided, use UMD instead
<a name="1.11.0"></a>

@@ -2,0 +11,0 @@ # [1.11.0](https://github.com/troch/route-node/compare/v1.10.0...v1.11.0) (2017-11-08)

163

dist/umd/route-node.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define('RouteNode', factory) :
typeof define === 'function' && define.amd ? define(factory) :
(global.RouteNode = factory());

@@ -96,106 +96,28 @@ }(this, (function () { 'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
var _extends$1 = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}return target;
};
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
var createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
var _createClass$1 = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
}
}return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
};
}();
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
function _classCallCheck$1(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
}
return target;
};
var toConsumableArray = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
} else {
return Array.from(arr);
}
};
var defaultOrConstrained = function defaultOrConstrained(match) {

@@ -229,2 +151,3 @@ return '(' + (match ? match.replace(/(^<|>$)/g, '') : '[a-zA-Z0-9-_.~%\':]+') + ')';

pattern: /^(?:\?|&)(?:\:)?([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(?:\[\])/
// regex: match => new RegExp('(?=(\?|.*&)' + match[0] + '(?=(\=|&|$)))')
}, {

@@ -235,2 +158,3 @@ // Query parameter: ?param1&param2

pattern: /^(?:\?|&)(?:\:)?([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/
// regex: match => new RegExp('(?=(\?|.*&)' + match[0] + '(?=(\=|&|$)))')
}, {

@@ -339,3 +263,3 @@ // Delimiter /

var Path = function () {
createClass(Path, null, [{
_createClass$1(Path, null, [{
key: 'createPath',

@@ -353,3 +277,3 @@ value: function createPath(path) {

function Path(path) {
classCallCheck(this, Path);
_classCallCheck$1(this, Path);

@@ -393,3 +317,3 @@ if (!path) throw new Error('Missing path in Path constructor');

createClass(Path, [{
_createClass$1(Path, [{
key: '_getParams',

@@ -430,3 +354,3 @@ value: function _getParams(type) {

var options = _extends({ trailingSlash: false }, opts);
var options = _extends$1({ trailingSlash: false }, opts);
// trailingSlash: falsy => non optional, truthy => optional

@@ -460,3 +384,3 @@ var source = optTrailingSlash(this.source, options.trailingSlash);

var options = _extends({ delimited: true }, opts);
var options = _extends$1({ delimited: true }, opts);
// Check if partial match (start of given path matches regex)

@@ -489,3 +413,3 @@ // trailingSlash: falsy => non optional, truthy => optional

var options = _extends({ ignoreConstraints: false, ignoreSearch: false }, opts);
var options = _extends$1({ ignoreConstraints: false, ignoreSearch: false }, opts);
var encodedParams = Object.keys(params).reduce(function (acc, key) {

@@ -556,5 +480,16 @@ if (!exists(params[key])) {

}]);
return Path;
}();
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var noop = function noop() {};

@@ -569,4 +504,5 @@

var parent = arguments[4];
classCallCheck(this, RouteNode);
_classCallCheck(this, RouteNode);
this.name = name;

@@ -586,3 +522,3 @@ this.absolute = /^~/.test(path);

createClass(RouteNode, [{
_createClass(RouteNode, [{
key: 'checkParents',

@@ -915,6 +851,6 @@ value: function checkParents() {

var parser = segments[i].parser;
searchParams.push.apply(searchParams, toConsumableArray(parser.queryParams));
searchParams.push.apply(searchParams, toConsumableArray(parser.queryParamsBr));
nonSearchParams.push.apply(nonSearchParams, toConsumableArray(parser.urlParams));
nonSearchParams.push.apply(nonSearchParams, toConsumableArray(parser.spatParams));
searchParams.push.apply(searchParams, _toConsumableArray(parser.queryParams));
searchParams.push.apply(searchParams, _toConsumableArray(parser.queryParamsBr));
nonSearchParams.push.apply(nonSearchParams, _toConsumableArray(parser.urlParams));
nonSearchParams.push.apply(nonSearchParams, _toConsumableArray(parser.spatParams));
}

@@ -926,3 +862,3 @@

}, []);
searchParams.push.apply(searchParams, toConsumableArray(extraParams));
searchParams.push.apply(searchParams, _toConsumableArray(extraParams));
}

@@ -1046,3 +982,3 @@

matchedSegments.reverse();
matchedSegments.push.apply(matchedSegments, toConsumableArray(firstSegmentParams));
matchedSegments.push.apply(matchedSegments, _toConsumableArray(firstSegmentParams));
matchedSegments.reverse();

@@ -1062,2 +998,3 @@ }

}]);
return RouteNode;

@@ -1064,0 +1001,0 @@ }();

{
"name": "route-node",
"version": "1.11.0",
"version": "2.0.0",
"description": "A package to create a tree of named routes",
"main": "dist/commonjs/route-node.js",
"jsnext:main": "modules/RouteNode.js",
"main": "dist/cjs/route-node.js",
"jsnext:main": "dist/es/route-node.js",
"scripts": {

@@ -11,7 +11,4 @@ "test": "mocha --compilers js:babel-core/register --recursive \"test/main.js\"",

"lint": "eslint modules/*.js",
"build:amd": "rollup -c rollup.config.js --format amd",
"build:umd": "rollup -c rollup.config.js --format umd",
"build:cjs": "mkdirp dist/commonjs && babel modules/RouteNode.js -o dist/commonjs/route-node.js",
"clean": "rimraf dist",
"build": "npm run clean && npm run build:amd && npm run build:umd && npm run build:cjs",
"build": "npm run clean && rollup -c rollup.config.js",
"clog": "conventional-changelog -p angular -i CHANGELOG.md -s"

@@ -35,29 +32,27 @@ },

"devDependencies": {
"babel-cli": "~6.24.1",
"babel-core": "~6.24.1",
"babel-eslint": "~7.2.3",
"babel-cli": "~6.26.0",
"babel-core": "~6.26.0",
"babel-eslint": "~8.0.2",
"babel-plugin-add-module-exports": "~0.2.1",
"babel-plugin-transform-class-properties": "~6.24.1",
"babel-plugin-transform-export-extensions": "~6.22.0",
"babel-plugin-transform-object-rest-spread": "~6.23.0",
"babel-preset-es2015": "~6.24.1",
"babel-preset-es2015-rollup": "~3.0.0",
"conventional-changelog": "~1.1.3",
"coveralls": "~2.13.1",
"eslint": "~3.19.0",
"babel-plugin-transform-object-rest-spread": "~6.26.0",
"babel-preset-env": "~1.6.1",
"conventional-changelog": "~1.1.7",
"coveralls": "~3.0.0",
"eslint": "~4.11.0",
"isparta": "~4.0.0",
"lodash.omit": "~4.5.0",
"mkdirp": "~0.5.1",
"mocha": "~3.4.1",
"rimraf": "~2.6.1",
"rollup": "~0.41.6",
"rollup-plugin-babel": "~2.7.1",
"mocha": "~4.0.1",
"rimraf": "~2.6.2",
"rollup": "~0.51.6",
"rollup-plugin-babel": "~3.0.2",
"rollup-plugin-node-resolve": "~3.0.0",
"should": "~11.2.1",
"yargs": "~8.0.1"
"should": "~13.1.3"
},
"dependencies": {
"path-parser": "2.1.0",
"path-parser": "3.0.0",
"search-params": "~1.3.0"
}
}

Sorry, the diff of this file is not supported yet

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