code: function ensureDefault(val, def) {
      if ((util_1.isNullOrUndefined(val) || val === '') && !chek_1.isUndefined(def))
          return def;
      return val;
  }
docs: Ensures a default value when current is undefined.
  
  @param val the current value.
  @param def the default value.