Skip to content

Commit

Permalink
Add hop()
Browse files Browse the repository at this point in the history
  • Loading branch information
signalpoint committed Nov 30, 2022
1 parent 18994fa commit efc41d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/includes/common.inc.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ dg.killCamelCase = function(str, separator) {
return jDrupal.lcfirst(str).replace(/([A-Z])/g, separator + '$1').toLowerCase();
};

/**
* A shortcut for obj.hasOwnProperty(val).
*/
dg.hop = function(obj, val) { return obj.hasOwnProperty(val); };

dg.inArray = function(needle, haystack) { return jDrupal.inArray(needle, haystack); };

/**
Expand Down

0 comments on commit efc41d7

Please sign in to comment.