From 446895beca8bbf47a9faf8cc3f3cf3a049f292de Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Thu, 22 Jan 2015 02:57:21 -0500 Subject: [PATCH] chore(all): prepare release 0.2.2 --- bower.json | 2 +- dist/amd/dsl.js | 3 +-- dist/amd/index.js | 61 +++++++++++++++++++++--------------------- dist/commonjs/dsl.js | 3 +-- dist/commonjs/index.js | 61 +++++++++++++++++++++--------------------- dist/system/dsl.js | 3 +-- dist/system/index.js | 61 +++++++++++++++++++++--------------------- doc/CHANGELOG.md | 4 +++ package.json | 2 +- 9 files changed, 99 insertions(+), 101 deletions(-) diff --git a/bower.json b/bower.json index 6403dd2..ff60d61 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-route-recognizer", - "version": "0.2.1", + "version": "0.2.2", "description": "A lightweight JavaScript library that matches paths against registered routes. It includes support for dynamic and star segments and nested handlers.", "keywords": [ "aurelia", diff --git a/dist/amd/dsl.js b/dist/amd/dsl.js index 5b49991..13fc904 100644 --- a/dist/amd/dsl.js +++ b/dist/amd/dsl.js @@ -67,8 +67,7 @@ define(["exports"], function (exports) { function addRoute(routeArray, path, handler) { var len = 0; - for (var i = 0, - l = routeArray.length; i < l; i++) { + for (var i = 0, l = routeArray.length; i < l; i++) { len += routeArray[i].path.length; } diff --git a/dist/amd/index.js b/dist/amd/index.js index 07ce566..0beb4c4 100644 --- a/dist/amd/index.js +++ b/dist/amd/index.js @@ -17,10 +17,10 @@ define(["exports", "./dsl"], function (exports, _dsl) { } StaticSegment.prototype = { eachChar: function (callback) { - var string = this.string, ch; + var string = this.string, + ch; - for (var i = 0, - l = string.length; i < l; i++) { + for (var i = 0, l = string.length; i < l; i++) { ch = string.charAt(i); callback({ validChars: ch }); } @@ -88,9 +88,9 @@ define(["exports", "./dsl"], function (exports, _dsl) { var segments = route.split("/"), results = []; - for (var i = 0, - l = segments.length; i < l; i++) { - var segment = segments[i], match; + for (var i = 0, l = segments.length; i < l; i++) { + var segment = segments[i], + match; if (match = segment.match(/^:([^\/]+)$/)) { results.push(new DynamicSegment(match[1])); @@ -120,8 +120,7 @@ define(["exports", "./dsl"], function (exports, _dsl) { get: function (charSpec) { var nextStates = this.nextStates; - for (var i = 0, - l = nextStates.length; i < l; i++) { + for (var i = 0, l = nextStates.length; i < l; i++) { var child = nextStates[i]; var isEqual = child.charSpec.validChars === charSpec.validChars; @@ -151,12 +150,14 @@ define(["exports", "./dsl"], function (exports, _dsl) { return state; }, match: function (ch) { - var nextStates = this.nextStates, child, charSpec, chars; + var nextStates = this.nextStates, + child, + charSpec, + chars; var returned = []; - for (var i = 0, - l = nextStates.length; i < l; i++) { + for (var i = 0, l = nextStates.length; i < l; i++) { child = nextStates[i]; charSpec = child.charSpec; @@ -206,8 +207,7 @@ define(["exports", "./dsl"], function (exports, _dsl) { function recognizeChar(states, ch) { var nextStates = []; - for (var i = 0, - l = states.length; i < l; i++) { + for (var i = 0, l = states.length; i < l; i++) { var state = states[i]; nextStates = nextStates.concat(state.match(ch)); @@ -217,7 +217,8 @@ define(["exports", "./dsl"], function (exports, _dsl) { } var oCreate = Object.create || function (proto) { - function F() {} + var F = function () {}; + F.prototype = proto; return new F(); }; @@ -240,14 +241,12 @@ define(["exports", "./dsl"], function (exports, _dsl) { currentCapture = 1; var result = new RecognizeResults(queryParams); - for (var i = 0, - l = handlers.length; i < l; i++) { + for (var i = 0, l = handlers.length; i < l; i++) { var handler = handlers[i], names = handler.names, params = {}; - for (var j = 0, - m = names.length; j < m; j++) { + for (var j = 0, m = names.length; j < m; j++) { params[names[j]] = captures[currentCapture++]; } @@ -284,8 +283,7 @@ define(["exports", "./dsl"], function (exports, _dsl) { var isEmpty = true; - for (var i = 0, - l = routes.length; i < l; i++) { + for (var i = 0, l = routes.length; i < l; i++) { var route = routes[i], names = []; @@ -293,8 +291,7 @@ define(["exports", "./dsl"], function (exports, _dsl) { allSegments = allSegments.concat(segments); - for (var j = 0, - m = segments.length; j < m; j++) { + for (var j = 0, m = segments.length; j < m; j++) { var segment = segments[j]; if (segment instanceof EpsilonSegment) { @@ -338,8 +335,7 @@ define(["exports", "./dsl"], function (exports, _dsl) { throw new Error("There is no route named " + name); } - for (var i = 0, - l = route.handlers.length; i < l; i++) { + for (var i = 0, l = route.handlers.length; i < l; i++) { result.push(route.handlers[i]); } @@ -359,8 +355,7 @@ define(["exports", "./dsl"], function (exports, _dsl) { var segments = route.segments; - for (var i = 0, - l = segments.length; i < l; i++) { + for (var i = 0, l = segments.length; i < l; i++) { var segment = segments[i]; if (segment instanceof EpsilonSegment) { @@ -391,8 +386,7 @@ define(["exports", "./dsl"], function (exports, _dsl) { } } keys.sort(); - for (var i = 0, - len = keys.length; i < len; i++) { + for (var i = 0, len = keys.length; i < len; i++) { key = keys[i]; var value = params[key]; if (value === null) { @@ -400,8 +394,7 @@ define(["exports", "./dsl"], function (exports, _dsl) { } var pair = encodeURIComponent(key); if (isArray(value)) { - for (var j = 0, - l = value.length; j < l; j++) { + for (var j = 0, l = value.length; j < l; j++) { var arrayPair = key + "[]" + "=" + encodeURIComponent(value[j]); pairs.push(arrayPair); } @@ -449,7 +442,13 @@ define(["exports", "./dsl"], function (exports, _dsl) { }, recognize: function (path) { - var states = [this.rootState], pathLen, i, l, queryStart, queryParams = {}, isSlashDropped = false; + var states = [this.rootState], + pathLen, + i, + l, + queryStart, + queryParams = {}, + isSlashDropped = false; queryStart = path.indexOf("?"); if (queryStart !== -1) { diff --git a/dist/commonjs/dsl.js b/dist/commonjs/dsl.js index 0070fab..9410d82 100644 --- a/dist/commonjs/dsl.js +++ b/dist/commonjs/dsl.js @@ -66,8 +66,7 @@ function generateMatch(startingPath, matcher, delegate) { function addRoute(routeArray, path, handler) { var len = 0; - for (var i = 0, - l = routeArray.length; i < l; i++) { + for (var i = 0, l = routeArray.length; i < l; i++) { len += routeArray[i].path.length; } diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js index 30b4290..e9b2e50 100644 --- a/dist/commonjs/index.js +++ b/dist/commonjs/index.js @@ -16,10 +16,10 @@ function StaticSegment(string) { } StaticSegment.prototype = { eachChar: function (callback) { - var string = this.string, ch; + var string = this.string, + ch; - for (var i = 0, - l = string.length; i < l; i++) { + for (var i = 0, l = string.length; i < l; i++) { ch = string.charAt(i); callback({ validChars: ch }); } @@ -87,9 +87,9 @@ function parse(route, names, types) { var segments = route.split("/"), results = []; - for (var i = 0, - l = segments.length; i < l; i++) { - var segment = segments[i], match; + for (var i = 0, l = segments.length; i < l; i++) { + var segment = segments[i], + match; if (match = segment.match(/^:([^\/]+)$/)) { results.push(new DynamicSegment(match[1])); @@ -119,8 +119,7 @@ State.prototype = { get: function (charSpec) { var nextStates = this.nextStates; - for (var i = 0, - l = nextStates.length; i < l; i++) { + for (var i = 0, l = nextStates.length; i < l; i++) { var child = nextStates[i]; var isEqual = child.charSpec.validChars === charSpec.validChars; @@ -150,12 +149,14 @@ State.prototype = { return state; }, match: function (ch) { - var nextStates = this.nextStates, child, charSpec, chars; + var nextStates = this.nextStates, + child, + charSpec, + chars; var returned = []; - for (var i = 0, - l = nextStates.length; i < l; i++) { + for (var i = 0, l = nextStates.length; i < l; i++) { child = nextStates[i]; charSpec = child.charSpec; @@ -205,8 +206,7 @@ function sortSolutions(states) { function recognizeChar(states, ch) { var nextStates = []; - for (var i = 0, - l = states.length; i < l; i++) { + for (var i = 0, l = states.length; i < l; i++) { var state = states[i]; nextStates = nextStates.concat(state.match(ch)); @@ -216,7 +216,8 @@ function recognizeChar(states, ch) { } var oCreate = Object.create || function (proto) { - function F() {} + var F = function () {}; + F.prototype = proto; return new F(); }; @@ -239,14 +240,12 @@ function findHandler(state, path, queryParams) { currentCapture = 1; var result = new RecognizeResults(queryParams); - for (var i = 0, - l = handlers.length; i < l; i++) { + for (var i = 0, l = handlers.length; i < l; i++) { var handler = handlers[i], names = handler.names, params = {}; - for (var j = 0, - m = names.length; j < m; j++) { + for (var j = 0, m = names.length; j < m; j++) { params[names[j]] = captures[currentCapture++]; } @@ -283,8 +282,7 @@ RouteRecognizer.prototype = { var isEmpty = true; - for (var i = 0, - l = routes.length; i < l; i++) { + for (var i = 0, l = routes.length; i < l; i++) { var route = routes[i], names = []; @@ -292,8 +290,7 @@ RouteRecognizer.prototype = { allSegments = allSegments.concat(segments); - for (var j = 0, - m = segments.length; j < m; j++) { + for (var j = 0, m = segments.length; j < m; j++) { var segment = segments[j]; if (segment instanceof EpsilonSegment) { @@ -337,8 +334,7 @@ RouteRecognizer.prototype = { throw new Error("There is no route named " + name); } - for (var i = 0, - l = route.handlers.length; i < l; i++) { + for (var i = 0, l = route.handlers.length; i < l; i++) { result.push(route.handlers[i]); } @@ -358,8 +354,7 @@ RouteRecognizer.prototype = { var segments = route.segments; - for (var i = 0, - l = segments.length; i < l; i++) { + for (var i = 0, l = segments.length; i < l; i++) { var segment = segments[i]; if (segment instanceof EpsilonSegment) { @@ -390,8 +385,7 @@ RouteRecognizer.prototype = { } } keys.sort(); - for (var i = 0, - len = keys.length; i < len; i++) { + for (var i = 0, len = keys.length; i < len; i++) { key = keys[i]; var value = params[key]; if (value === null) { @@ -399,8 +393,7 @@ RouteRecognizer.prototype = { } var pair = encodeURIComponent(key); if (isArray(value)) { - for (var j = 0, - l = value.length; j < l; j++) { + for (var j = 0, l = value.length; j < l; j++) { var arrayPair = key + "[]" + "=" + encodeURIComponent(value[j]); pairs.push(arrayPair); } @@ -448,7 +441,13 @@ RouteRecognizer.prototype = { }, recognize: function (path) { - var states = [this.rootState], pathLen, i, l, queryStart, queryParams = {}, isSlashDropped = false; + var states = [this.rootState], + pathLen, + i, + l, + queryStart, + queryParams = {}, + isSlashDropped = false; queryStart = path.indexOf("?"); if (queryStart !== -1) { diff --git a/dist/system/dsl.js b/dist/system/dsl.js index 9eeed33..0f791cd 100644 --- a/dist/system/dsl.js +++ b/dist/system/dsl.js @@ -29,8 +29,7 @@ System.register([], function (_export) { function addRoute(routeArray, path, handler) { var len = 0; - for (var i = 0, - l = routeArray.length; i < l; i++) { + for (var i = 0, l = routeArray.length; i < l; i++) { len += routeArray[i].path.length; } diff --git a/dist/system/index.js b/dist/system/index.js index 8a06e92..5d5695f 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -34,9 +34,9 @@ System.register(["./dsl"], function (_export) { var segments = route.split("/"), results = []; - for (var i = 0, - l = segments.length; i < l; i++) { - var segment = segments[i], match; + for (var i = 0, l = segments.length; i < l; i++) { + var segment = segments[i], + match; if (match = segment.match(/^:([^\/]+)$/)) { results.push(new DynamicSegment(match[1])); @@ -91,8 +91,7 @@ System.register(["./dsl"], function (_export) { function recognizeChar(states, ch) { var nextStates = []; - for (var i = 0, - l = states.length; i < l; i++) { + for (var i = 0, l = states.length; i < l; i++) { var state = states[i]; nextStates = nextStates.concat(state.match(ch)); @@ -113,14 +112,12 @@ System.register(["./dsl"], function (_export) { currentCapture = 1; var result = new RecognizeResults(queryParams); - for (var i = 0, - l = handlers.length; i < l; i++) { + for (var i = 0, l = handlers.length; i < l; i++) { var handler = handlers[i], names = handler.names, params = {}; - for (var j = 0, - m = names.length; j < m; j++) { + for (var j = 0, m = names.length; j < m; j++) { params[names[j]] = captures[currentCapture++]; } @@ -149,10 +146,10 @@ System.register(["./dsl"], function (_export) { escapeRegex = new RegExp("(\\" + specials.join("|\\") + ")", "g"); StaticSegment.prototype = { eachChar: function (callback) { - var string = this.string, ch; + var string = this.string, + ch; - for (var i = 0, - l = string.length; i < l; i++) { + for (var i = 0, l = string.length; i < l; i++) { ch = string.charAt(i); callback({ validChars: ch }); } @@ -201,8 +198,7 @@ System.register(["./dsl"], function (_export) { get: function (charSpec) { var nextStates = this.nextStates; - for (var i = 0, - l = nextStates.length; i < l; i++) { + for (var i = 0, l = nextStates.length; i < l; i++) { var child = nextStates[i]; var isEqual = child.charSpec.validChars === charSpec.validChars; @@ -232,12 +228,14 @@ System.register(["./dsl"], function (_export) { return state; }, match: function (ch) { - var nextStates = this.nextStates, child, charSpec, chars; + var nextStates = this.nextStates, + child, + charSpec, + chars; var returned = []; - for (var i = 0, - l = nextStates.length; i < l; i++) { + for (var i = 0, l = nextStates.length; i < l; i++) { child = nextStates[i]; charSpec = child.charSpec; @@ -259,7 +257,8 @@ System.register(["./dsl"], function (_export) { }; oCreate = Object.create || function (proto) { - function F() {} + var F = function () {}; + F.prototype = proto; return new F(); }; @@ -287,8 +286,7 @@ System.register(["./dsl"], function (_export) { var isEmpty = true; - for (var i = 0, - l = routes.length; i < l; i++) { + for (var i = 0, l = routes.length; i < l; i++) { var route = routes[i], names = []; @@ -296,8 +294,7 @@ System.register(["./dsl"], function (_export) { allSegments = allSegments.concat(segments); - for (var j = 0, - m = segments.length; j < m; j++) { + for (var j = 0, m = segments.length; j < m; j++) { var segment = segments[j]; if (segment instanceof EpsilonSegment) { @@ -341,8 +338,7 @@ System.register(["./dsl"], function (_export) { throw new Error("There is no route named " + name); } - for (var i = 0, - l = route.handlers.length; i < l; i++) { + for (var i = 0, l = route.handlers.length; i < l; i++) { result.push(route.handlers[i]); } @@ -362,8 +358,7 @@ System.register(["./dsl"], function (_export) { var segments = route.segments; - for (var i = 0, - l = segments.length; i < l; i++) { + for (var i = 0, l = segments.length; i < l; i++) { var segment = segments[i]; if (segment instanceof EpsilonSegment) { @@ -394,8 +389,7 @@ System.register(["./dsl"], function (_export) { } } keys.sort(); - for (var i = 0, - len = keys.length; i < len; i++) { + for (var i = 0, len = keys.length; i < len; i++) { key = keys[i]; var value = params[key]; if (value === null) { @@ -403,8 +397,7 @@ System.register(["./dsl"], function (_export) { } var pair = encodeURIComponent(key); if (isArray(value)) { - for (var j = 0, - l = value.length; j < l; j++) { + for (var j = 0, l = value.length; j < l; j++) { var arrayPair = key + "[]" + "=" + encodeURIComponent(value[j]); pairs.push(arrayPair); } @@ -452,7 +445,13 @@ System.register(["./dsl"], function (_export) { }, recognize: function (path) { - var states = [this.rootState], pathLen, i, l, queryStart, queryParams = {}, isSlashDropped = false; + var states = [this.rootState], + pathLen, + i, + l, + queryStart, + queryParams = {}, + isSlashDropped = false; queryStart = path.indexOf("?"); if (queryStart !== -1) { diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index eb2e7f7..94e5a72 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,7 @@ +### 0.2.2 (2015-01-22) + +* Update compiler. + ### 0.2.1 (2015-01-12) * Update compiled output. diff --git a/package.json b/package.json index 96aeaa3..1ffa5ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-route-recognizer", - "version": "0.2.1", + "version": "0.2.2", "description": "A lightweight JavaScript library that matches paths against registered routes. It includes support for dynamic and star segments and nested handlers.", "keywords": [ "aurelia",