make-mp-data 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
  3. package/utils.js +7 -2
package/index.js CHANGED
@@ -104,7 +104,7 @@ async function main(config) {
104
104
  chance.normal({ mean: avgEvPerUser, dev: avgEvPerUser / 4 })
105
105
  );
106
106
 
107
- if (firstEvents) {
107
+ if (firstEvents.length) {
108
108
  eventData.push(
109
109
  makeEvent(
110
110
  distinct_id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-mp-data",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "builds all mixpanel primitives for a given project",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/utils.js CHANGED
@@ -8,8 +8,13 @@ const utc = require('dayjs/plugin/utc');
8
8
  dayjs.extend(utc);
9
9
 
10
10
  function pick() {
11
- const choice = chance.pickone(this);
12
- return choice;
11
+ try {
12
+ const choice = chance.pickone(this);
13
+ return choice;
14
+ }
15
+ catch (e) {
16
+ return null;
17
+ }
13
18
  }
14
19
 
15
20
  function date(inTheLast = 30, isPast = true, format = 'YYYY-MM-DD') {