make-mp-data 1.0.11 → 1.0.12

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 (2) hide show
  1. package/index.js +4 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -73,8 +73,8 @@ async function main(config) {
73
73
  };
74
74
  }
75
75
 
76
- // weigh events for random selection
77
- const weightedEvents = events
76
+ // weigh events for random selection
77
+ const weightedEvents = events
78
78
  .reduce((acc, event) => {
79
79
  const weight = event.weight || 1;
80
80
  for (let i = 0; i < weight; i++) {
@@ -318,7 +318,8 @@ function buildFileNames(config) {
318
318
  const { format = "csv", groupKeys = [], lookupTables = [] } = config;
319
319
  const extension = format === "csv" ? "csv" : "json";
320
320
  const current = dayjs.utc().format("MM-DD-HH");
321
- const writeDir = mkdir('./data');
321
+ let writeDir = null;
322
+ if (config.writeToDisk) writeDir = mkdir('./data');
322
323
 
323
324
  const writePaths = {
324
325
  eventFiles: [path.join(writeDir, `events-${current}.${extension}`)],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-mp-data",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "builds all mixpanel primitives for a given project",
5
5
  "main": "index.js",
6
6
  "scripts": {