This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Function to convert a JSON object to a TypeScript interface with nested interfaces. | |
* @param {Object} obj - The JSON object to convert. | |
* @param {string} interfaceName - The name of the TypeScript interface. | |
* @returns {string} - The TypeScript interface as a string. | |
*/ | |
function jsonToTypeScriptInterface(obj, interfaceName = 'RootObject') { | |
let result = `interface ${interfaceName} {\n`; | |
const nestedInterfaces = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
// Example JSON object with mixed types in arrays | |
const json = { | |
"name": "John Doe", | |
"age": 30, | |
"email": "[email protected]", | |
"isActive": true, | |
"roles": [ | |
{"role": "admin", "level": 1}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins: [{src: '@/plugins/pwa-update.js', mode: 'client'}] | |
pwa: { | |
workbox: { | |
cachingExtensions: "@/plugins/workbox-range-request.js", | |
skipWaiting: true | |
}, | |
} |