aliases.py 562 B

12345678910111213141516
  1. def validateAliases(aliases):
  2. """
  3. Validates an aliases data object at a basic, structural level.
  4. """
  5. if type(aliases) is not dict:
  6. raise Exception("Your alises file is not structured properly. It needs to be an object type.")
  7. for target, dest in aliases.items():
  8. # checking the target isn't necessary because the JSON parser will break if it's not a string.
  9. if type(dest) is not str:
  10. raise ValueError(f"The destination for the alias '{target}' is not formatted as a string. It needs to be a string.")