code: function serialize(input) {
      const value = JSON.stringify(input);
      return value === undefined
          ? reject(new Error(`Unsupported type ${type(input)}`))
          : resolve(value);
  }
docs: Marshalls the JS input
  
  @param {Mixed} input
  @return {Promise}