Skip to content

Instantly share code, notes, and snippets.

@reggi
Created July 9, 2015 05:07
Show Gist options
  • Save reggi/87ee52f3958e96855a0d to your computer and use it in GitHub Desktop.
Save reggi/87ee52f3958e96855a0d to your computer and use it in GitHub Desktop.
var _ = require("underscore")
module.exports = {
hasOnly: function(obj, keys){
if(_.difference(_.keys(obj), keys).length == 0 &&
_.difference(keys, _.keys(obj)).length == 0) return true
return false
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment