From efc41d7ba8ce6ab932d6c70c7a9cb9d5fa9cf636 Mon Sep 17 00:00:00 2001 From: Tyler Frankenstein Date: Wed, 30 Nov 2022 12:45:59 -0500 Subject: [PATCH] Add hop() --- src/includes/common.inc.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/includes/common.inc.js b/src/includes/common.inc.js index 98a70ae5..53a6c67f 100644 --- a/src/includes/common.inc.js +++ b/src/includes/common.inc.js @@ -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); }; /**