Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@segment/loosely-validate-event

f2prateek4.4m2.0.0

Loosely validate an event.

readme

@segment/loosely-validate-event

Loosely validate an event.

Example

const validate = require('@segment/loosely-validate-event')

const event = {
  type: 'track',
  userId: 'abc123',
  properties: {
    foo: 'bar'
  }
}

validate(event) // throws if `event` does not pass validation