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

  // prepare clean user info
  let cleanUserInfo = NSMutableDictionary.alloc().init()

  // get keys
  let keys = Utils.convertToJSArray(userInfo.allKeys())

  // add values other than data populator's
  for (let i = 0; i < keys.length; i++) {
    let key = keys[i]
    if (key.indexOf('datapopulator') === -1) {
      cleanUserInfo.setValue_forKey(userInfo.valueForKey(key), key)
    }
  }

  // set clean user info
  layer.setUserInfo(cleanUserInfo)
}
Removes any Data Populator data from a layer's metadata.

@param {MSLayer} layer