Skip to content

Commit

Permalink
Fix tests and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Nov 8, 2020
1 parent 45c6146 commit c9caf2d
Show file tree
Hide file tree
Showing 19 changed files with 677 additions and 575 deletions.
6 changes: 3 additions & 3 deletions lib/common/iff-else.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ module.exports = function (processFuncArray) {

// Babel 6.17.0 did not transpile something in the old version similar to this
// const runProcessFuncArray = funcs => processFuncArray.call(this, fnArgs, funcs);
var that = this;
var runProcessFuncArray = function (funcs) {
const that = this;
const runProcessFuncArray = function (funcs) {
return processFuncArray.call(that, fnArgs, funcs);
};

// const check = typeof predicate === 'function' ? predicate(...fnArgs) : !!predicate;
var check = typeof predicate === 'function' ? predicate.apply(that, fnArgs) : !!predicate;
const check = typeof predicate === 'function' ? predicate.apply(that, fnArgs) : !!predicate;

if (!check) {
return runProcessFuncArray(falseFuncs);
Expand Down
2 changes: 1 addition & 1 deletion lib/services/calling-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const defaults = {
};

// Set app wide defaults
function callingParamsDefaults (defaultPropNames = [], defaultNewProps) {
function callingParamsDefaults (defaultPropNames = [], defaultNewProps = undefined) {
if (defaultPropNames) {
defaults.propNames = Array.isArray(defaultPropNames) ? defaultPropNames : [defaultPropNames];
}
Expand Down
2 changes: 1 addition & 1 deletion lib/services/fast-join.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = function fastJoin (joins1, query1) {
};
};

function joinsForQuery ({ joins } = {}, query, context = {}) {
function joinsForQuery ({ joins } = {}, query = undefined, context = {}) {
const runtime = [];

Object.keys(joins).forEach(outerLabel => {
Expand Down
3 changes: 2 additions & 1 deletion lib/services/fgraphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ module.exports = function fgraphql (options1 = {}) {
}

options.inclAllFields = contextParams.provider
? options.inclAllFieldsClient : options.inclAllFieldsServer;
? options.inclAllFieldsClient
: options.inclAllFieldsServer;
debug(`inclAllField ${options.inclAllFields}`);

// Build content parameter passed to resolver functions.
Expand Down
3 changes: 2 additions & 1 deletion lib/services/populate.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ function populateAddChild (options, context, parentItem, childSchema, depth) {
});

return (childSchema.include && result)
? populateItemArray(options, context, result, include, depth) : result;
? populateItemArray(options, context, result, include, depth)
: result;
})
.then(items => ({ nameAs, items }));
}
Expand Down
12 changes: 7 additions & 5 deletions lib/services/stash-before.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ module.exports = function (prop) {
throw new errors.BadRequest('Id is required. (stashBefore)');
}

const params = context.method === 'get' ? context.params : {
provider: context.params.provider,
authenticated: context.params.authenticated,
user: context.params.user
};
const params = context.method === 'get'
? context.params
: {
provider: context.params.provider,
authenticated: context.params.authenticated,
user: context.params.user
};

return context.service.get(context.id, {
...params,
Expand Down
Loading

0 comments on commit c9caf2d

Please sign in to comment.