This repository has been archived by the owner on Jan 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored UsergridRequest to handle all requests, added additional h…
…elpers
- Loading branch information
1 parent
5e9f827
commit 65f7769
Showing
24 changed files
with
419 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict' | ||
|
||
var _ = require('lodash') | ||
|
||
module.exports = function(args) { | ||
return _.flattenDeep(Array.prototype.slice.call(args)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
'use strict' | ||
|
||
var _ = require('lodash') | ||
var ok = require('objectkit'), | ||
_ = require('lodash') | ||
|
||
module.exports = function(callback) { | ||
return _.isFunction(callback) ? callback : function() {} | ||
module.exports = function() { | ||
var args = _.flattenDeep(Array.prototype.slice.call(arguments)) | ||
var emptyFunc = function() {} | ||
return _.first(_.flattenDeep([args.reverse(), ok(args).getIfExists('0.callback'), emptyFunc]).filter(_.isFunction)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
'use strict' | ||
|
||
var client = require('./client'), | ||
var args = require('./args'), | ||
client = require('./client'), | ||
cb = require('./cb'), | ||
build = require('./build'), | ||
query = require('./query'), | ||
config = require('./config'), | ||
time = require('./time'), | ||
mutability = require('./mutability'), | ||
user = require('./user'), | ||
_ = require('lodash') | ||
|
||
// by mixing this in here, lodash-uuid is available everywhere lodash is used. | ||
_.mixin(require('lodash-uuid')) | ||
|
||
module.exports = _.assign(module.exports, { | ||
args: args, | ||
client: client, | ||
cb: cb, | ||
build: build, | ||
query: query, | ||
config: config, | ||
time: time | ||
time: time, | ||
user: user | ||
}, mutability) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict' | ||
|
||
var _ = require('lodash') | ||
|
||
module.exports = { | ||
uniqueId: function(user) { | ||
return _.first([user.uuid, user.username, user.email].filter(_.isString)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.