Skip to content

Commit 5ded8db

Browse files
authored
Merge pull request #60 from clarakosi/update-dependencies
updated dependencies
2 parents 9f51089 + fafda4b commit 5ded8db

File tree

11 files changed

+30
-95
lines changed

11 files changed

+30
-95
lines changed

.jscs.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

.jshintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.jshintrc

Lines changed: 0 additions & 26 deletions
This file was deleted.

lib/node.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ class Node {
4646

4747
/**
4848
* Register a child with a node.
49-
*
50-
* @param {string|object} key: One of
49+
* @param {string|Object} key: One of
5150
* - A string representing a fixed path segment.
5251
* - A meta key of the format { type: 'meta', name: 'someName' }. This
5352
* is used to attach annotations in the tree that won't interfere with
@@ -85,11 +84,10 @@ class Node {
8584

8685
/**
8786
* Look up a child in a node.
88-
*
89-
* @param {string|object} segment, one of
87+
* @param {string|Object} segment, one of
9088
* - A string,
9189
* - Pattern match objects as described in @setChild.
92-
* @param {object} params, an accumulator object used to build up
90+
* @param {Object} params, an accumulator object used to build up
9391
* parameters encountered during the lookup process.
9492
* @param {bool} exact, whether to do an exact segment lookup
9593
* (where * and ** only match themselves)

lib/reqTemplate.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,11 @@ const globalMethods = {
9090

9191
requestTemplate(spec, options) {
9292
const tpl = new Template(spec, options);
93-
return (model) => tpl.expand(model);
93+
return model => tpl.expand(model);
9494
},
9595

9696
/**
9797
* Formats a date in a requested format
98-
*
9998
* @param date date to format
10099
* @param [format] optional format, defaults to RFC 822 format
101100
*/
@@ -116,7 +115,7 @@ const globalMethods = {
116115
if (typeof date === 'string' && /^\d+$/.test(date)) {
117116
// It's a string, but may be it's just a stringified timestamp.
118117
// Check if it actually is.
119-
date = new Date(parseInt(date));
118+
date = new Date(parseInt(date, 10));
120119
} else {
121120
date = new Date(Date.parse(date));
122121
}
@@ -146,7 +145,6 @@ const globalMethods = {
146145

147146
/**
148147
* Applies `decodeURIComponent` to the provided string
149-
*
150148
* @param data {string} data needed to be decoded.
151149
* @returns {string}
152150
*/
@@ -296,7 +294,7 @@ const simpleTemplate = new RegExp('^(?:\\/(?:[a-zA-Z_\\.-]+|'
296294
function createURIResolver(uri, globals) {
297295
if (simpleTemplate.test(uri) && uri.indexOf('{') >= 0) {
298296
const pathTemplate = new URI(uri, {}, true);
299-
return (context) => pathTemplate.expand(context.rm.request.params);
297+
return context => pathTemplate.expand(context.rm.request.params);
300298
} else if (/\{/.test(uri)) {
301299
const tassemblyTemplate = splitAndPrepareTAssemblyTemplate(uri);
302300
// console.log('tass', spec.uri, tassemblyTemplate);
@@ -319,7 +317,7 @@ function replaceComplexTemplates(part, subSpec, globals) {
319317
});
320318
return res;
321319
} else if (Array.isArray(subSpec)) {
322-
return subSpec.map((elem) => replaceComplexTemplates(part, elem, globals));
320+
return subSpec.map(elem => replaceComplexTemplates(part, elem, globals));
323321
} else if (subSpec && subSpec.constructor === String || subSpec === '') {
324322
if (/\{[^}]+\}/.test(subSpec)) {
325323
// Strip trailing newlines, so that we can use yaml multi-line

lib/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class Router {
126126
if (node || prevNode && path[path.length - 1] === '') {
127127
if (path[path.length - 1] === '') {
128128
// Pass in a listing
129-
params._ls = prevNode.keys().filter((key) => !/^meta_/.test(key));
129+
params._ls = prevNode.keys().filter(key => !/^meta_/.test(key));
130130
}
131131
return {
132132
params,

lib/uri.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ class URI {
4848

4949
/**
5050
* Builds and returns the full, bounded string path for this URI object
51-
*
52-
* @return {String} the complete path of this URI object
53-
* @param {object} options {
51+
* @return {string} the complete path of this URI object
52+
* @param {Object} options {
5453
* format {string} Either 'simplePattern' or 'fullPattern'. [optional]
5554
* params {object} parameters to use during serialization
5655
* }
@@ -109,7 +108,7 @@ class URI {
109108

110109
/**
111110
* Expand all parameters in the URI and return a new URI.
112-
* @param {object} params (optional) Parameters to use for expansion. Uses
111+
* @param {Object} params (optional) Parameters to use for expansion. Uses
113112
* URI-assigned parameters if not supplied.
114113
* @return {URI}
115114
*/
@@ -159,9 +158,8 @@ class URI {
159158

160159
/**
161160
* Checks if the URI starts with the given path prefix
162-
*
163-
* @param {String|URI} pathOrURI the prefix path to check for
164-
* @return {Boolean} whether this URI starts with the given prefix path
161+
* @param {string|URI} pathOrURI the prefix path to check for
162+
* @return {boolean} whether this URI starts with the given prefix path
165163
*/
166164
startsWith(pathOrURI) {
167165
let uri;

lib/utils.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ const unescapes = {
9393
* RFC6570 compliant encoder for `reserved` expansion - encodes a URI component
9494
* while preserving reserved & unreserved characters
9595
* (http://tools.ietf.org/html/rfc3986#section-2.2) and pct-encoded triplets
96-
*
9796
* @param string - a string to encode
98-
* @return {String} an encoded string
97+
* @return {string} an encoded string
9998
*/
10099
utils.encodeReserved = (string) => {
101100
const res = encodeURI(string);
@@ -104,7 +103,7 @@ utils.encodeReserved = (string) => {
104103
} else {
105104
// Un-escape [ and ] (which are legal in RFC6570), and un-do
106105
// double percent escapes.
107-
return res.replace(/%5B|%5D|%25/gi, (m) => unescapes[m]);
106+
return res.replace(/%5B|%5D|%25/gi, m => unescapes[m]);
108107
}
109108
};
110109

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger-router",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"description": "An efficient swagger 2 based router with support for multiple APIs. For use in RESTBase.",
55
"main": "index.js",
66
"scripts": {
@@ -30,20 +30,21 @@
3030
"url": "https://github.com/wikimedia/swagger-router/issues"
3131
},
3232
"dependencies": {
33-
"bluebird": "^3.4.0",
34-
"js-yaml": "^3.6.1",
33+
"bluebird": "^3.5.2",
34+
"js-yaml": "^3.12.0",
3535
"tassembly": "^0.2.3",
36-
"template-expression-compiler": "^0.1.8",
37-
"cassandra-uuid": "^0.0.2"
36+
"template-expression-compiler": "^0.1.10",
37+
"cassandra-uuid": "^0.1.0"
3838
},
3939
"devDependencies": {
40-
"mocha": "^3.1.0",
41-
"mocha-jshint": "^2.3.1",
40+
"mocha": "^5.2.0",
4241
"istanbul": "^0.4.5",
43-
"mocha-lcov-reporter": "^1.2.0",
44-
"coveralls": "^2.11.14",
45-
"mocha-jscs": "^5.0.1",
46-
"mocha-eslint":"^3.0.1",
47-
"eslint-config-node-services": "^1.0.4"
42+
"mocha-lcov-reporter": "^1.3.0",
43+
"coveralls": "^3.0.2",
44+
"mocha-eslint": "^4.1.0",
45+
"eslint-config-node-services": "^2.2.5",
46+
"eslint-config-wikimedia": "^0.5.0",
47+
"eslint-plugin-jsdoc": "^3.9.1",
48+
"eslint-plugin-json": "^1.2.1"
4849
}
4950
}

test/features/router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,11 @@ describe('Repeat on cloned tree', function() {
375375
});
376376
});
377377

378-
describe.only('addSpec', function() {
378+
describe('addSpec', function() {
379379
it('should add a spec via `addSpec`', function() {
380380
const testRouter = new Router();
381381
const fullSpec = makeFullSpec();
382382
testRouter.addSpec(fullSpec);
383383
deepEqual(Object.keys(testRouter._root._children).length, 4)
384384
})
385-
})
385+
})

0 commit comments

Comments
 (0)