function merge(a, b) {
      for (var key in b) {
          if (typeof b[key] !== 'object' || b[key] === null) {
              a[key] = b[key];
          }
          else if (Array.isArray(b[key])) {
              a[key] = a[key] || [];
              // fix #292 - skip duplicated values from merge object (b)
              b[key].forEach(function (value) {
                  if (a[key].indexOf(value) === -1) {
                      a[key].push(value);
                  }
              });
          }
          else if (typeof a[key] !== 'object' || a[key] === null || Array.isArray(a[key])) {
              a[key] = merge({}, b[key]);
          }
          else {
              a[key] = merge(a[key], b[key]);
          }
      }
      return a;
  }
CHANGE: This Makes sure that we're not adding extra spaces in generated value,
As such behaviour generates invalid data when pattern is mentioned.

To avoid infinite loop, make sure we keep adding spaces in cases where value is empty string