text: 'use strict';
  
  angular.module('openshiftCommonUI')
    .filter('parseJSON', function() {
      return function(json) {
        // return original value if its null or undefined
        if (!json) {
          return null;
        }
  
        // return the parsed obj if its valid
        try {
          var jsonObj = JSON.parse(json);
          if (typeof jsonObj === "object") {
            return jsonObj;
          }
          else {
            return null;
          }
        }
        catch (e) {
          // it wasn't valid json
          return null;
        }
      };
    });
  