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

  // LEGACY: filter out any data from old data populator versions
  let newUserInfo = NSMutableDictionary.alloc().init()
  let keys = Utils.convertToJSArray(userInfo.allKeys())
  for (let i = 0; i < keys.length; i++) {
    let key = keys[i]
    if (key.indexOf('datapopulator') === -1) {
      newUserInfo.setValue_forKey(userInfo.valueForKey(key), key)
    }
  }
  userInfo = newUserInfo

  // set data dictionary
  userInfo.setValue_forKey(dataDict, 'com.precious-forever.sketch.datapopulator')

  // set new user info
  layer.setUserInfo(userInfo)
}
Sets a new data dictionary in userInfo of the layer.

@param {MSLayer} layer
@param {NSMutableDictionary} dataDict