Skip to content

Commit

Permalink
fix: update to latest sync sig
Browse files Browse the repository at this point in the history
  • Loading branch information
pemrouz committed Jul 24, 2016
1 parent 6b087ee commit ce52e58
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
});
exports.default = helpers;

var _identity = require('utilise/identity');

var _identity2 = _interopRequireDefault(_identity);

var _client = require('utilise/client');

var _client2 = _interopRequireDefault(_client);
Expand Down Expand Up @@ -68,17 +72,16 @@ var attach = function attach(next) {
};

var serialise = function serialise(next) {
return function (res, change) {
if (change) return next ? next.call(this, res, change) : true;
var helpers = res.headers.helpers;
return function (req) {
var helpers = req.headers.helpers;

(0, _keys2.default)(helpers).filter(function (name) {
return _is2.default.fn(helpers[name]);
}).map(function (name) {
return helpers[name] = (0, _str2.default)(helpers[name]);
});

return next ? next.call(this, res, change) : res;
return (next || _identity2.default)(req);
};
};

Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ const attach = next => res => {
return res
}

const serialise = next => function(res, change) {
if (change) return next ? next.call(this, res, change) : true
const helpers = res.headers.helpers
const serialise = next => req => {
const helpers = req.headers.helpers

keys(helpers)
.filter(name => is.fn(helpers[name]))
.map(name => helpers[name] = str(helpers[name]))

return next ? next.call(this, res, change) : res
return (next || identity)(req)
}

const log = require('utilise/log')('[ri/helpers]')
import identity from 'utilise/identity'
import client from 'utilise/client'
import values from 'utilise/values'
import keys from 'utilise/keys'
Expand Down

0 comments on commit ce52e58

Please sign in to comment.