0.0.1 • Published 10 years ago

funmatch v0.0.1

Weekly downloads
1
License
BSD-2-Clause
Repository
github
Last release
10 years ago
var funmatch = require("funmatch");

var saveProfile = funmatch([
  {
    match: { _id: {$ne: undefined }},
    handle: function (options, next) {
      // create
    }
  },
  {
    handle: function (options, next) {
      // do something
    }
  }
]);


// PUT
saveProfile({ _id: "existing" }, function () {
  
});

// POST
saveProfile({}, function () {
  
})