summaryrefslogtreecommitdiff
path: root/scripts/lib/util.js
blob: c51a5bc46777562b2d74f3d6ef75a9128427d081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(function () {
  Object.defineProperties(util, { 
    "getBody" :  { 
      value :  function(f) {
        if (f !== null && f !== undefined && f instanceof Function) {
          var m = f.toString().match(/\{([\s\S]*)\}/m)[1];
          return m.replace(/^\s*\/\/.*$/mg,'');
        }
        return null;
      }
    }
  });
  Object.freeze(util);
})();