Skip to content
This repository has been archived by the owner on Aug 10, 2020. It is now read-only.

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidWells authored and sw-yx committed Mar 29, 2019
1 parent b6b43e3 commit bd6840f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils/telemetry/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ function track(eventName, payload) {
if (eventName.indexOf('cli:') === -1) {
eventName = `cli:${eventName}`
}


const allowed = () => true
// event 'cli:command' bypasses validation
const isValid = (eventName === 'cli:command') ? allowed : isValidEventName
// to ensure clean data, validate event name
if (!isValidEventName(eventName, eventConfig)) {
if (!isValid(eventName, eventConfig)) {
return false
}

Expand Down

0 comments on commit bd6840f

Please sign in to comment.