|
Lines 6-11
const fs = require("fs");
Link Here
|
| 6 |
const generatedDataCache = new Set(); |
6 |
const generatedDataCache = new Set(); |
| 7 |
|
7 |
|
| 8 |
const generateMockData = (type, properties) => { |
8 |
const generateMockData = (type, properties) => { |
|
|
9 |
if (properties.hasOwnProperty("enum")) { |
| 10 |
let values = properties.enum; |
| 11 |
return values[Math.floor(Math.random() * values.length)]; |
| 12 |
} |
| 13 |
|
| 9 |
switch (type) { |
14 |
switch (type) { |
| 10 |
case "string": |
15 |
case "string": |
| 11 |
if (properties?.maxLength) { |
16 |
if (properties?.maxLength) { |
| 12 |
- |
|
|