Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fs = require('fs')
const path = require('path')
const changeCase = require('change-case')
const CodeGen = require('swagger-typescript-codegen').CodeGen
const prettier = require('prettier')
function generateTypingsForApi(file) {
const swagger = JSON.parse(fs.readFileSync(file, 'UTF-8'))
const definitions = CodeGen.getTypescriptCode({
className: 'SauceLabs',
swagger,
template: {
class: fs.readFileSync('./scripts/class-definitions.mustache', 'utf-8'),
method: fs.readFileSync('./scripts/method.mustache', 'utf-8'),
}
})
const methods = CodeGen.getTypescriptCode({
className: 'SauceLabs',
swagger,
template: {