Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(validation): tougher rules on validate for device/user id #84

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

kelvin-lu
Copy link
Contributor

@kelvin-lu kelvin-lu commented Mar 2, 2021

Summary

Adds a check to make sure user and device ID's are the correct type (will fail if numeric)

Helps debug #63 (dataPL ticket tracked internally)

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?:

@kelvin-lu kelvin-lu changed the title feat(validation): tougher rules on validate feat(validation): tougher rules on validate for device/user id Mar 2, 2021
@@ -4,36 +4,54 @@ import { isValidEvent } from '../src/validate';
describe('isValidEvent', () => {
it('should pass on valid events with device id', () => {
const validEvent: Event = {
event_type: 'NOT_A_REAL_EVENT_TYPE',
device_id: 'NOT_A_REAL_DEVICE_ID',
event_type: 'VALID_BUT_FAKE_EVENT_TYPE',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decided to make these strings a little more meaningful

@kelvin-lu kelvin-lu merged commit 0fb26ce into main Mar 3, 2021
@kelvin-lu kelvin-lu deleted the 273/string-validate branch March 3, 2021 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants