Advertisement
nrianx

Untitled

Nov 28th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. var Check = {
  2. type: function(item) {
  3. if (typeof item != "undefined") return true;
  4. return false;
  5. },
  6. json: function(item) {
  7. try { JSON.parse(item) }
  8. catch (e) { return false }
  9. return true;
  10. },
  11. user: function(id, data, callback) {
  12. Setting.update({'0': id}, data).exec(function afterwards(err,ok){
  13. if (err) return callback(true);
  14. Profile.findOne({id_profil: id}).exec(function findOneCB(err,profile){
  15. if (err) return callback(true);
  16. return callback(null, profile);
  17. });
  18. })
  19. },
  20. post: function(data, callback) {
  21. if (Check.type(data.tags) && (Check.type(data.like) || Check.type(data.follow) || Check.type(data.unfollow) || (Check.type(data.comment) && typeof Check.type(data.comments)))) {
  22. return 'жопв';
  23. }
  24. return 'хуй';
  25. }
  26. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement