function getDataDictionary(layer) {
  // get user info
  let userInfo = NSMutableDictionary.dictionaryWithDictionary(layer.userInfo())

  // get plugin data dictionary
  let dataDict = userInfo.valueForKey('com.precious-forever.sketch.datapopulator')

  // LEGACY: get values for old versions of data populator
  if (!dataDict) dataDict = userInfo.valueForKey('com.precious-forever.sketch.datapopulator2')
  if (!dataDict) dataDict = userInfo.valueForKey('com.precious-forever.sketch.datapopulatorBETA')

  // get mutable dictionary from dictionary
  dataDict = NSMutableDictionary.dictionaryWithDictionary(dataDict)

  return dataDict
}
Retrieves the data dictionary from layer's userInfo.

@param {MSLayer} layer
@returns {NSMutableDictionary}