function setCommandParamsToMetadata(layer, params) {
  // get layer user info
  let userInfo = NSMutableDictionary.dictionaryWithDictionary(layer.userInfo())

  // set params
  userInfo.setValue_forKey(params, 'datapopulator')

  // set new user info
  layer.setUserInfo(userInfo)
}
Adds the provided params to the metadata of the layer. This way, the other
plugin can read those params.

@param {MSLayer} layer
@param {Array} params