{"size": 472, "ext": "js", "max_stars_repo_path": "lib/lib/verifyData.js", "max_stars_repo_name": "JonathanLehner/meteor-comments-ui", "max_stars_repo_stars_event_min_datetime": "2016-07-13T20:39:33.000Z", "max_stars_repo_stars_event_max_datetime": "2020-01-30T00:01:44.000Z", "max_issues_repo_path": "lib/lib/verifyData.js", "max_issues_repo_name": "JonathanLehner/meteor-comments-ui", "max_issues_repo_issues_event_min_datetime": "2016-07-02T21:29:34.000Z", "max_issues_repo_issues_event_max_datetime": "2018-10-15T19:40:04.000Z", "max_forks_repo_path": "lib/lib/verifyData.js", "max_forks_repo_name": "JonathanLehner/meteor-comments-ui", "max_forks_repo_forks_event_min_datetime": "2016-07-02T21:54:42.000Z", "max_forks_repo_forks_event_max_datetime": "2020-04-17T20:16:15.000Z"}
{"max_stars_count": 26, "max_issues_count": 38, "max_forks_count": 24, "avg_line_length": 27.7647058824, "max_line_length": 76, "alphanum_fraction": 0.7415254237}
import { check, Match } from 'meteor/check'
import userService from '../services/user'

export const verifyContent = content => {
  check(content, String)
  return content.trim()
}

export const verifyUserData = (meteorUserId, anonUserData, referenceId) => {
  check(anonUserData, Match.Maybe(Object))
  anonUserData = anonUserData || {}

  userService.verifyAnonUserData(anonUserData, referenceId)

  return { anonUserData, userId: (meteorUserId || anonUserData._id) }
}
