Skip to content

Commit

Permalink
Updated to keigai 1.2.0, implemented array.iterate()
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Mar 13, 2015
1 parent 6438864 commit bfa085e
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 1.2.3
- Updated to keigai 1.2.0
- Implemented `array.iterate()`

## 1.2.2
- Updated `babel` transpiler (renamed)
- Updated core dependencies
Expand Down
2 changes: 1 addition & 1 deletion doc/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ <h5>Returns:</h5>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2015-02-25T07:55:46-05:00 using the <a
on 2015-03-12T20:01:50-04:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ <h2>License</h2>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2015-02-25T07:55:46-05:00 using the <a
on 2015-03-12T20:01:50-04:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
4 changes: 2 additions & 2 deletions doc/module-tenso.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h2>
<dt class="tag-version">Version:</dt>
<dd class="tag-version">
<ul class="dummy">
<li>1.2.2</li>
<li>1.2.3</li>
</ul>
</dd>

Expand Down Expand Up @@ -283,7 +283,7 @@ <h5>Type:</h5>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2015-02-25T07:55:46-05:00 using the <a
on 2015-03-12T20:01:50-04:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion doc/modules.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ <h2>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2015-02-25T07:55:46-05:00 using the <a
on 2015-03-12T20:01:50-04:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
18 changes: 9 additions & 9 deletions lib/tenso.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* @license BSD-3 <https://raw.github.com/avoidwork/tenso/master/LICENSE>
* @link http://avoidwork.github.io/tenso
* @module tenso
* @version 1.2.2
* @version 1.2.3
*/
const CONFIG = require( __dirname + "/../config.json" );
const VERSION = "1.2.2";
const VERSION = "1.2.3";
const SERVER = "tenso/" + VERSION;

let keigai = require( "keigai" ),
Expand Down Expand Up @@ -337,7 +337,7 @@ let auth = ( obj, config ) => {
(() => {
let r = "(?!/auth/(";

array.each( authUris, ( i ) => {
array.iterate( authUris, ( i ) => {
r += i.replace( "_uri", "" ) + "|";
} );

Expand Down Expand Up @@ -376,7 +376,7 @@ let auth = ( obj, config ) => {
}
}

array.each( config.auth.basic.list || [], ( i ) => {
array.iterate( config.auth.basic.list || [], ( i ) => {
let args = i.split( ":" );

if ( args.length > 0 ) {
Expand Down Expand Up @@ -671,7 +671,7 @@ let bootstrap = ( obj, config ) => {
args = req.body ? array.chunk( req.body.split( REGEX.body_split ), 2 ) : [];
req.body = {};

array.each( args, ( i ) => {
array.iterate( args, ( i ) => {
req.body[ i[ 0 ] ] = coerce( i[ 1 ] );
} );
}
Expand Down Expand Up @@ -799,7 +799,7 @@ let hypermedia = ( server, req, rep, headers ) => {
if ( keys.length === 0 ) {
obj = null;
} else {
array.each( keys, ( i ) => {
array.iterate( keys, ( i ) => {
let collection, uri;

// If ID like keys are found, and are not URIs, they are assumed to be root collections
Expand Down Expand Up @@ -876,7 +876,7 @@ let hypermedia = ( server, req, rep, headers ) => {
} ).join( "&" );
}

array.each( rep.data.result, ( i ) => {
array.iterate( rep.data.result, ( i ) => {
let uri;

if ( typeof i == "string" && REGEX.scheme.test( i ) ) {
Expand Down Expand Up @@ -1023,7 +1023,7 @@ let rate = ( obj, req, res, next ) => {
results = obj.rate( req, config.override ),
valid = results.shift();

array.each( headers, ( i, idx ) => {
array.iterate( headers, ( i, idx ) => {
res.setHeader( i, results[ idx ] );
} );

Expand Down Expand Up @@ -1071,7 +1071,7 @@ let zuul = ( protect ) => {
let uri = req.parsed.path,
protectd = false;

array.each( protect, ( r ) => {
array.iterate( protect, ( r ) => {
if ( r.test( uri ) ) {
return !( protectd = true );
}
Expand Down
18 changes: 9 additions & 9 deletions lib/tenso.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ var _classCallCheck = function (instance, Constructor) { if (!(instance instance
* @license BSD-3 <https://raw.github.com/avoidwork/tenso/master/LICENSE>
* @link http://avoidwork.github.io/tenso
* @module tenso
* @version 1.2.2
* @version 1.2.3
*/
var CONFIG = require(__dirname + "/../config.json");
var VERSION = "1.2.2";
var VERSION = "1.2.3";
var SERVER = "tenso/" + VERSION;

var keigai = require("keigai"),
Expand Down Expand Up @@ -386,7 +386,7 @@ var auth = function (obj, config) {
(function () {
var r = "(?!/auth/(";

array.each(authUris, function (i) {
array.iterate(authUris, function (i) {
r += i.replace("_uri", "") + "|";
});

Expand Down Expand Up @@ -424,7 +424,7 @@ var auth = function (obj, config) {
}
};

array.each(config.auth.basic.list || [], function (i) {
array.iterate(config.auth.basic.list || [], function (i) {
var args = i.split(":");

if (args.length > 0) {
Expand Down Expand Up @@ -719,7 +719,7 @@ var bootstrap = function (obj, config) {
args = req.body ? array.chunk(req.body.split(REGEX.body_split), 2) : [];
req.body = {};

array.each(args, function (i) {
array.iterate(args, function (i) {
req.body[i[0]] = coerce(i[1]);
});
}
Expand Down Expand Up @@ -856,7 +856,7 @@ var hypermedia = function (server, req, rep, headers) {
if (keys.length === 0) {
obj = null;
} else {
array.each(keys, function (i) {
array.iterate(keys, function (i) {
var collection = undefined,
uri = undefined;

Expand Down Expand Up @@ -934,7 +934,7 @@ var hypermedia = function (server, req, rep, headers) {
}).join("&");
}

array.each(rep.data.result, function (i) {
array.iterate(rep.data.result, function (i) {
var uri = undefined;

if (typeof i == "string" && REGEX.scheme.test(i)) {
Expand Down Expand Up @@ -1084,7 +1084,7 @@ var rate = function (obj, req, res, next) {
results = obj.rate(req, config.override),
valid = results.shift();

array.each(headers, function (i, idx) {
array.iterate(headers, function (i, idx) {
res.setHeader(i, results[idx]);
});

Expand Down Expand Up @@ -1132,7 +1132,7 @@ var zuul = function (protect) {
var uri = req.parsed.path,
protectd = false;

array.each(protect, function (r) {
array.iterate(protect, function (r) {
if (r.test(uri)) {
return !(protectd = true);
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is a REST API facade for node.js, designed to simplify the implementation of APIs.",
"version": "1.2.2",
"version": "1.2.3",
"homepage": "http://avoidwork.github.io/tenso",
"author": {
"name": "Jason Mulligan",
Expand All @@ -28,8 +28,8 @@
"test": "grunt test"
},
"dependencies": {
"keigai": "~1.1.5",
"turtle.io": "~3.2.4",
"keigai": "~1.2.0",
"turtle.io": "~3.2.5",
"cookie-parser": "~1.3.4",
"express-session": "~1.10.3",
"passport": "~0.2.1",
Expand Down
4 changes: 2 additions & 2 deletions src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ let auth = ( obj, config ) => {
(() => {
let r = "(?!/auth/(";

array.each( authUris, ( i ) => {
array.iterate( authUris, ( i ) => {
r += i.replace( "_uri", "" ) + "|";
} );

Expand Down Expand Up @@ -180,7 +180,7 @@ let auth = ( obj, config ) => {
}
}

array.each( config.auth.basic.list || [], ( i ) => {
array.iterate( config.auth.basic.list || [], ( i ) => {
let args = i.split( ":" );

if ( args.length > 0 ) {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let bootstrap = ( obj, config ) => {
args = req.body ? array.chunk( req.body.split( REGEX.body_split ), 2 ) : [];
req.body = {};

array.each( args, ( i ) => {
array.iterate( args, ( i ) => {
req.body[ i[ 0 ] ] = coerce( i[ 1 ] );
} );
}
Expand Down
4 changes: 2 additions & 2 deletions src/hypermedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let hypermedia = ( server, req, rep, headers ) => {
if ( keys.length === 0 ) {
obj = null;
} else {
array.each( keys, ( i ) => {
array.iterate( keys, ( i ) => {
let collection, uri;

// If ID like keys are found, and are not URIs, they are assumed to be root collections
Expand Down Expand Up @@ -103,7 +103,7 @@ let hypermedia = ( server, req, rep, headers ) => {
} ).join( "&" );
}

array.each( rep.data.result, ( i ) => {
array.iterate( rep.data.result, ( i ) => {
let uri;

if ( typeof i == "string" && REGEX.scheme.test( i ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/rate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let rate = ( obj, req, res, next ) => {
results = obj.rate( req, config.override ),
valid = results.shift();

array.each( headers, ( i, idx ) => {
array.iterate( headers, ( i, idx ) => {
res.setHeader( i, results[ idx ] );
} );

Expand Down
2 changes: 1 addition & 1 deletion src/zuul.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let zuul = ( protect ) => {
let uri = req.parsed.path,
protectd = false;

array.each( protect, ( r ) => {
array.iterate( protect, ( r ) => {
if ( r.test( uri ) ) {
return !( protectd = true );
}
Expand Down

0 comments on commit bfa085e

Please sign in to comment.