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

Commit

Permalink
feat(analytics): add & deprecate pre-defined analytics events (invert…
Browse files Browse the repository at this point in the history
…ase#3385)

* updating analytics types

* further type updates

* update log events for analytics

* update validation

* feat(analytics): update events & tests

* tests(analytics): update

* build(analytics): types & type tests

* chore(analytics): update to revised api

* feat(analytics): further updates for package

* Apply suggestions from code review

Co-authored-by: Mike Diarmid <[email protected]>

* tests(analytics): update tests

* tests(ml-vision): stop testing ml-vision

* chore(*): spelling

* chore(*): spelling

* chore(analytics): update ts docs

Co-authored-by: Mike Diarmid <[email protected]>
[publish]
  • Loading branch information
russellwheatley authored Jul 9, 2020
1 parent 588508f commit d5e99db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/common/struct.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export const validateStruct = (value = {}, struct, prefix = '') => {
};

export const validateCompound = (source = {}, a, b, prefix = '') => {
if (isUndefined(source[a]) && !isUndefined(source[b])) {
if (
(isUndefined(source[a]) && !isUndefined(source[b])) ||
(!isUndefined(source[a]) && isUndefined(source[b]))
) {
throw new Error(
`${prefix} if you supply the '${a}' parameter, you must also supply the '${b}' parameter.`,
);
Expand Down

0 comments on commit d5e99db

Please sign in to comment.